Versions in this module Expand all Collapse all v0 v0.1.17 Mar 29, 2024 Changes in this version + const FilterOperatorEqual + const GrantTypeRefreshToken + const InvalidEmailError + const UnknownDetailError + const ValidationError + var BlankStr = NewString("") + func CheckResponseError(r *http.Response) error + type APIError struct + Category string + Context ErrContext + CorrelationID string + Details []ErrDetail + HTTPStatusCode int + Links ErrLinks + Message string + Status string + SubCategory string + func (e APIError) Error() string + type APIKey struct + func (a *APIKey) SetAuthentication(r *http.Request) error + type AssociationConfig struct + ToObject ObjectType + ToObjectID string + Type AssociationType + type AssociationResult struct + ID string + Type string + type AssociationType string + const AssociationTypeCompanyToContact + const AssociationTypeCompanyToDeal + const AssociationTypeContactToCompany + const AssociationTypeContactToDeal + const AssociationTypeContactToEngagement + const AssociationTypeContactToTicket + const AssociationTypeDealToCompany + const AssociationTypeDealToContact + const AssociationTypeDealToEngagement + const AssociationTypeDealToLineItem + const AssociationTypeDealToTicket + type Associations struct + Companies struct{ ... } + Contacts struct{ ... } + Deals struct{ ... } + type AuthMethod func(c *Client) + func SetAPIKey(key string) AuthMethod + func SetOAuth(config *OAuthConfig) AuthMethod + type Authenticator interface + SetAuthentication func(r *http.Request) error + type CRM struct + Company CompanyService + Contact ContactService + Deal DealService + Owner OwnerService + Pipeline PipelineService + type Client struct + CRM *CRM + HTTPClient *http.Client + func NewClient(setAuthMethod AuthMethod, opts ...Option) (*Client, error) + func (c *Client) CreateAndDo(method, relPath string, data, option, resource interface{}) error + func (c *Client) Delete(path string) error + func (c *Client) Get(path string, resource interface{}, option *RequestQueryOption) error + func (c *Client) NewRequest(method, path string, body, option interface{}) (*http.Request, error) + func (c *Client) Patch(path string, data, resource interface{}) error + func (c *Client) Post(path string, data, resource interface{}) error + func (c *Client) Put(path string, data, resource interface{}) error + type Company struct + City *HsStr + Domain *HsStr + HsCreateDate *HsTime + HsLastModifiedDate *HsTime + HsObjectID *HsStr + HubspotOwnerAssignedDate *HsTime + HubspotOwnerID *HsStr + ID *HsStr + Industry *HsStr + Name *HsStr + Phone *HsStr + ProductNames *HsStr + State *HsStr + TrialEndDate *HsStr + TrialStatus *HsStr + func (c *Company) AddProductName(name string) + func (c *Company) RemoveProductName(name string) + type CompanyService interface + Create func(company interface{}) (*ResponseResource, error) + Delete func(companyID string) error + Get func(companyID string, owner interface{}, option *RequestQueryOption) (*ResponseResource, error) + GetAll func(company interface{}, option *RequestQueryOption) (*ResponseResourceMulti, error) + Search func(company interface{}, option *RequestSearchOption) (*ResponseResourceMulti, error) + Update func(companyID string, company interface{}) (*ResponseResource, error) + type CompanyServiceOp struct + func (s *CompanyServiceOp) Create(company interface{}) (*ResponseResource, error) + func (s *CompanyServiceOp) Delete(companyID string) error + func (s *CompanyServiceOp) Get(companyID string, company interface{}, option *RequestQueryOption) (*ResponseResource, error) + func (s *CompanyServiceOp) GetAll(company interface{}, option *RequestQueryOption) (*ResponseResourceMulti, error) + func (s *CompanyServiceOp) Search(company interface{}, option *RequestSearchOption) (*ResponseResourceMulti, error) + func (s *CompanyServiceOp) Update(companyID string, company interface{}) (*ResponseResource, error) + type Contact struct + Address *HsStr + AnnualRevenue *HsStr + ApiFreeTrial HsBool + City *HsStr + CloseDate *HsTime + Company *HsStr + CompanySize *HsStr + Country *HsStr + CreateDate *HsTime + CurrentlyInWorkflow *HsStr + DateOfBirth *HsStr + DaysToClose *HsStr + Degree *HsStr + DiscoveryChannel *HsStr + Email *HsStr + EngagementsLastMeetingBooked *HsTime + EngagementsLastMeetingBookedCampaign *HsStr + EngagementsLastMeetingBookedMedium *HsStr + EngagementsLastMeetingBookedSource *HsStr + Fax *HsStr + FieldOfStudy *HsStr + FirstConversionDate *HsTime + FirstConversionEventName *HsStr + FirstDealCreatedDate *HsTime + FirstName *HsStr + Gender *HsStr + GraduationDate *HsStr + HsAnalyticsAveragePageViews *HsStr + HsAnalyticsFirstReferrer *HsStr + HsAnalyticsFirstTimestamp *HsTime + HsAnalyticsFirstTouchConvertingCampaign *HsStr + HsAnalyticsFirstURL *HsStr + HsAnalyticsFirstVisitTimestamp *HsTime + HsAnalyticsLastReferrer *HsStr + HsAnalyticsLastTimestamp *HsTime + HsAnalyticsLastTouchConvertingCampaign *HsStr + HsAnalyticsLastURL *HsStr + HsAnalyticsLastVisitTimestamp *HsTime + HsAnalyticsNumEventCompletions *HsStr + HsAnalyticsNumPageViews *HsStr + HsAnalyticsNumVisits *HsStr + HsAnalyticsRevenue *HsStr + HsAnalyticsSource *HsStr + HsAnalyticsSourceData1 *HsStr + HsAnalyticsSourceData2 *HsStr + HsBuyingRole *HsStr + HsContentMembershipEmailConfirmed HsBool + HsContentMembershipNotes *HsStr + HsContentMembershipRegisteredAt *HsTime + HsContentMembershipRegistrationDomainSentTo *HsStr + HsContentMembershipRegistrationEmailSentAt *HsTime + HsContentMembershipStatus *HsStr + HsCreateDate *HsTime + HsEmailBadAddress HsBool + HsEmailBounce *HsStr + HsEmailClick *HsStr + HsEmailClickDate *HsTime + HsEmailConfirmationStatus *HsStr + HsEmailDelivered *HsStr + HsEmailDomain *HsStr + HsEmailFirstOpenDate *HsTime + HsEmailFirstSendDate *HsTime + HsEmailHardBounceReasonEnum *HsStr + HsEmailLastClickDate *HsTime + HsEmailLastEmailName *HsStr + HsEmailLastOpenDate *HsTime + HsEmailLastSendDate *HsTime + HsEmailOpen *HsStr + HsEmailOpenDate *HsTime + HsEmailOptOut HsBool + HsEmailOptOut6766004 *HsStr + HsEmailOptOut6766098 *HsStr + HsEmailOptOut6766099 *HsStr + HsEmailOptOut6766130 *HsStr + HsEmailQuarantined HsBool + HsEmailSendsSinceLastEngagement *HsStr + HsFeedbackLastNpsFollowUp *HsStr + HsFeedbackLastNpsRating *HsStr + HsFeedbackLastSurveyDate *HsTime + HsIPTimezone *HsStr + HsIsUnworked *HsStr + HsLanguage *HsStr + HsLastSalesActivityTimestamp *HsTime + HsLeadStatus *HsStr + HsLifeCycleStageCustomerDate *HsTime + HsLifeCycleStageEvangelistDate *HsTime + HsLifeCycleStageLeadDate *HsTime + HsLifeCycleStageMarketingQualifiedLeadDate *HsTime + HsLifeCycleStageOpportunityDate *HsTime + HsLifeCycleStageOtherDate *HsTime + HsLifeCycleStageSalesQualifiedLeadDate *HsTime + HsLifeCycleStageSubscriberDate *HsTime + HsMarketableReasonID *HsStr + HsMarketableReasonType *HsStr + HsMarketableStatus *HsStr + HsMarketableUntilRenewal *HsStr + HsObjectID *HsStr + HsPersona *HsStr + HsPredictiveContactScoreV2 *HsStr + HsPredictiveScoringTier *HsStr + HsSalesEmailLastClicked *HsTime + HsSalesEmailLastOpened *HsTime + HsSalesEmailLastReplied *HsTime + HsSequencesIsEnrolled HsBool + HubspotOwnerAssignedDate *HsTime + HubspotOwnerID *HsStr + HubspotScore *HsStr + HubspotTeamID *HsStr + IPCity *HsStr + IPCountry *HsStr + IPCountryCode *HsStr + IPState *HsStr + IPStateCode *HsStr + Industry *HsStr + JobFunction *HsStr + JobTitle *HsStr + LastModifiedDate *HsTime + LastName *HsStr + LeadSource *HsStr + LifeCycleStage *HsStr + MaritalStatus *HsStr + Message *HsStr + MilitaryStatus *HsStr + MobilePhone *HsStr + NotesLastContacted *HsTime + NotesLastUpdated *HsTime + NotesNextActivityDate *HsTime + NumAssociatedDeals *HsStr + NumContactedNotes *HsStr + NumEmployees *HsStr + NumNotes *HsStr + NumUniqueConversionEvents *HsStr + PhoneNumber *HsStr + RecentConversionDate *HsTime + RecentConversionEventName *HsStr + RecentDealAmount *HsStr + RecentDealCloseDate *HsTime + RelationshipStatus *HsStr + Salutation *HsStr + School *HsStr + Seniority *HsStr + StartDate *HsStr + State *HsStr + TotalRevenue *HsStr + UserType *HsStr + UtmOriginalSource *HsStr + UtmOriginalSourceDrilldown1 *HsStr + UtmOriginalSourceDrilldown2 *HsStr + UtmOriginalSourceDrilldown3 *HsStr + Website *HsStr + WorkEmail *HsStr + Zip *HsStr + type ContactService interface + AssociateAnotherObj func(contactID string, conf *AssociationConfig) (*ResponseResource, error) + Create func(contact interface{}) (*ResponseResource, error) + Delete func(contactID string) error + Get func(contactID string, contact interface{}, option *RequestQueryOption) (*ResponseResource, error) + Search func(contact interface{}, option *RequestSearchOption) (*ResponseResourceMulti, error) + Update func(contactID string, contact interface{}) (*ResponseResource, error) + type ContactServiceOp struct + func (s *ContactServiceOp) AssociateAnotherObj(contactID string, conf *AssociationConfig) (*ResponseResource, error) + func (s *ContactServiceOp) Create(contact interface{}) (*ResponseResource, error) + func (s *ContactServiceOp) Delete(contactID string) error + func (s *ContactServiceOp) Get(contactID string, contact interface{}, option *RequestQueryOption) (*ResponseResource, error) + func (s *ContactServiceOp) Search(contact interface{}, option *RequestSearchOption) (*ResponseResourceMulti, error) + func (s *ContactServiceOp) Update(contactID string, contact interface{}) (*ResponseResource, error) + type Deal struct + Amount *HsStr + AmountInCompanyCurrency *HsStr + AnnualContractValue *HsStr + AnnualRecurringRevenue *HsStr + CloseDate *HsTime + ClosedLostReason *HsStr + ClosedWonReason *HsStr + CreateDate *HsTime + DealDescription *HsStr + DealName *HsStr + DealOwnerID *HsStr + DealStage *HsStr + DealType *HsStr + ForecastAmount *HsStr + ForecastCategory *HsStr + ForecastProbability *HsStr + LastActivityDate *HsTime + LastContacted *HsTime + LastModifiedDate *HsTime + MonthlyRecurringRevenue *HsStr + NextActivityDate *HsTime + NextStep *HsStr + NoOfLicenses *HsStr + NumberOfContacts *HsStr + NumberOfSalesActivities *HsStr + NumberOfTimesContacted *HsStr + ObjectID *HsStr + OwnerAssignedDate *HsTime + PackageName *HsStr + PipeLine *HsStr + ProductName *HsStr + TeamID *HsStr + TotalContractValue *HsStr + TrialEndDate *HsStr + Usage *HsStr + type DealService interface + AssociateAnotherObj func(dealID string, conf *AssociationConfig) (*ResponseResource, error) + Create func(deal interface{}) (*ResponseResource, error) + Delete func(dealID string) error + Get func(dealID string, deal interface{}, option *RequestQueryOption) (*ResponseResource, error) + Update func(dealID string, deal interface{}) (*ResponseResource, error) + type DealServiceOp struct + func (s *DealServiceOp) AssociateAnotherObj(dealID string, conf *AssociationConfig) (*ResponseResource, error) + func (s *DealServiceOp) Create(deal interface{}) (*ResponseResource, error) + func (s *DealServiceOp) Delete(dealID string) error + func (s *DealServiceOp) Get(dealID string, deal interface{}, option *RequestQueryOption) (*ResponseResource, error) + func (s *DealServiceOp) Update(dealID string, deal interface{}) (*ResponseResource, error) + type ErrContext struct + FromObjectType []string + ID []string + ObjectType []string + ToObjectType []string + Type []string + type ErrDetail struct + Error string + IsValid bool + Message string + Name string + type ErrLinks struct + APIKey string + KnowledgeBase string + type Filter struct + Operator string + PropertyName string + Value string + type FilterGroup struct + Filters []Filter + type HsBool bool + func (hb *HsBool) UnmarshalJSON(b []byte) error + type HsStr string + func NewString(s string) *HsStr + func (hs *HsStr) String() string + type HsTime time.Time + func NewTime(t time.Time) *HsTime + func (ht *HsTime) String() string + func (ht *HsTime) ToTime() *time.Time + func (ht *HsTime) UnmarshalJSON(b []byte) error + type Metadata struct + IsClosed *HsBool + Probability *HsStr + type OAuth struct + func (o *OAuth) SetAuthentication(r *http.Request) error + type OAuthConfig struct + ClientID string + ClientSecret string + GrantType string + RefreshToken string + type OAuthToken struct + AccessToken string + ExpiresIn int + Expiry time.Time + RefreshToken string + type OAuthTokenManager struct + Config *OAuthConfig + HTTPClient *http.Client + Token *OAuthToken + func (otm *OAuthTokenManager) RetrieveToken() (*OAuthToken, error) + type OAuthTokenRetriever interface + RetrieveToken func() (*OAuthToken, error) + type ObjectType string + const ObjectTypeCompany + const ObjectTypeContact + const ObjectTypeDeal + type Option func(c *Client) + func WithAPIVersion(version string) Option + func WithBaseURL(url *url.URL) Option + func WithHTTPClient(client *http.Client) Option + type Owner struct + Archived bool + CreatedAt *HsTime + Email *HsStr + FirstName *HsStr + ID *HsStr + LastName *HsStr + UpdatedAt *HsTime + UserID int + type OwnerService interface + Get func(ownerID string, owner interface{}, option *RequestQueryOption) (ResponseResourceNonObject, error) + GetAll func(owner interface{}, option *RequestQueryOption) (*ResponseResourceAll, error) + type OwnerServiceOp struct + func (s *OwnerServiceOp) Get(ownerID string, owner interface{}, option *RequestQueryOption) (ResponseResourceNonObject, error) + func (s *OwnerServiceOp) GetAll(owner interface{}, option *RequestQueryOption) (*ResponseResourceAll, error) + type Pipeline struct + Archived *HsBool + CreatedAt *HsTime + DisplayOrder int + Label *HsStr + Stages *[]Stage + UpdatedAt *HsTime + type PipelineService interface + Get func(pipelineID string, pipeline interface{}, option *RequestQueryOption) (ResponseResourceNonObject, error) + GetAll func(pipeline interface{}, option *RequestQueryOption) (*ResponseResourceAll, error) + type PipelineServiceOp struct + func (s *PipelineServiceOp) Get(pipelineID string, pipeline interface{}, option *RequestQueryOption) (ResponseResourceNonObject, error) + func (s *PipelineServiceOp) GetAll(pipeline interface{}, option *RequestQueryOption) (*ResponseResourceAll, error) + type RequestPayload struct + Properties interface{} + type RequestQueryOption struct + Archived bool + Associations []string + CustomProperties []string + IDProperty string + PaginateAssociations bool + Properties []string + type RequestSearchOption struct + FilterGroups []FilterGroup + type ResponseResource struct + Archived bool + ArchivedAt *HsTime + AssociationResults []AssociationResult + Associations *Associations + CreatedAt *HsTime + ID string + Properties interface{} + UpdatedAt *HsTime + type ResponseResourceAll struct + Results []interface{} + type ResponseResourceMulti struct + Results []ResponseResource + type ResponseResourceNonObject interface + type Stage struct + Archived *HsBool + CreatedAt *HsTime + DisplayOrder int + Label *HsStr + Metadata *Metadata + UpdatedAt *HsTime