gohubspot

package module
v0.0.0-...-5e4a04c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 12 Imported by: 0

README

gohubspot

A Golang hubspot API client

Documentation

Index

Constants

View Source
const (
	// Contact Operators:
	IsNotEmpty ContactOperator = "IS_NOT_EMPTY"
	IsEmpty    ContactOperator = "IS_EMPTY"
	Eq         ContactOperator = "EQ"
	NotEq      ContactOperator = "NEQ"
	Conatains  ContactOperator = "CONTAINS"
	Lt         ContactOperator = "LT"
	Lte        ContactOperator = "LTE"
	Gt         ContactOperator = "GT"
	SetAny     ContactOperator = "SET_ANY"
	SetNotAny  ContactOperator = "SET_NOT_ANY"
	SetEq      ContactOperator = "SET_EQ"
	SetNotEq   ContactOperator = "SET_NEQ"
	SetAll     ContactOperator = "SET_ALL"

	// ComputedProperty
	DateOfLastFormSubmission ComputedProperty = "DATE_OF_LAST_FORM_SUBMISSION"
	NumberOfFormsFilledOut   ComputedProperty = "NUMBER_OF_FORMS_FILLED_OUT"

	// ListMembership operator
	InList    ListMembershipOperator = "IN_LIST"
	NotInList ListMembershipOperator = "NOT_IN_LIST"

	// Form Submission
	HasFilledOutForm    FormSubmissionOperator = "HAS_FILLED_OUT_FORM"
	HasNotFilledOutForm FormSubmissionOperator = "HAS_NOT_FILLED_OUT_FORM"

	// Events
	HasEvent    EventsOpeerator = "HAS_EVENT"
	NotHasEvent EventsOpeerator = "NOT_HAS_EVENT"

	PageviewEq              PageviewsOperator = "HAS_PAGEVIEW_EQ"
	PageviewContains        PageviewsOperator = "HAS_PAGEVIEW_CONTAINS"
	PageviewMatchesRegexp   PageviewsOperator = "HAS_PAGEVIEW_MATCHES_REGEX"
	PageviewNotEq           PageviewsOperator = "NOT_HAS_PAGEVIEW_EQ"
	PageviewNotContains     PageviewsOperator = "NOT_HAS_PAGEVIEW_CONTAINS"
	PageviewNotMatchRegexpt PageviewsOperator = "NOT_HAS_PAGEVIEW_MATCHES_REGEX"
)

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

func DumpRequest

func DumpRequest(req *http.Request, showBody bool)

DumpRequest shows the request at console

func NewContactListOptions

func NewContactListOptions(listCount, offset int) *contactListsOptions

Types

type APIKeyAuth

type APIKeyAuth struct {
	// contains filtered or unexported fields
}

func NewAPIKeyAuth

func NewAPIKeyAuth(apikey string) APIKeyAuth

NewAPIKeyAuth create new API KEY Authenticator

func (APIKeyAuth) Authenticate

func (auth APIKeyAuth) Authenticate(request *http.Request) error

Authenticate set auth

type Association

type Association struct {
	ContactIds  []int `json:"contactIds"`
	CompanyIds  []int `json:"companyIds"`
	DealIds     []int `json:"dealIds"`
	OwnerIds    []int `json:"ownerIds"`
	WorkflowIds []int `json:"workflowIds"`
	TicketIds   []int `json:"ticketIds"`
}

type Attachment

type Attachment struct {
	ID int `json:"id"`
}

type Authenticator

type Authenticator interface {
	Authenticate(request *http.Request) error
}

Authenticator interface for auth

type CMSFilesService

type CMSFilesService service

func (*CMSFilesService) Upload

func (s *CMSFilesService) Upload(body interface{}, contentType string) (*File, error)

type CRMAssociationsService

type CRMAssociationsService service

func (*CRMAssociationsService) Create

func (s *CRMAssociationsService) Create(body interface{}) error

type CompaniesService

type CompaniesService service

type Company

type Company struct {
	PortalId   int               `json:"portalId"`
	CompanyId  int               `json:"companyId"`
	IsDeleted  bool              `json:"isDeleted"`
	Properties CompanyProperties `json:"properties"`
}

type CompanyProperties

type CompanyProperties struct {
}

type CompanyPropertiesService

type CompanyPropertiesService service

CompanyPropertiesService Company Properties Service definition

func (*CompanyPropertiesService) Create

func (s *CompanyPropertiesService) Create(property ItemProperty) (*ItemProperty, error)

Create create a contact property

func (*CompanyPropertiesService) CreateGroup

CreateGroup creates a contact property group

func (*CompanyPropertiesService) Delete

func (s *CompanyPropertiesService) Delete(name string) error

Delete deletes a contact property by name

func (*CompanyPropertiesService) DeleteGroup

func (s *CompanyPropertiesService) DeleteGroup(name string) error

DeleteGroup deletes a contact property group

func (*CompanyPropertiesService) GetAll

GetAll gets all company properties

func (*CompanyPropertiesService) GetByName

func (s *CompanyPropertiesService) GetByName(name string) (*ItemProperty, error)

GetByName gets company property by name

func (*CompanyPropertiesService) GetGroups

GetGroups gets all contacts property groups

func (*CompanyPropertiesService) Update

func (s *CompanyPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)

Update updates an existing property by it name

func (*CompanyPropertiesService) UpdateGroup

func (s *CompanyPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)

UpdateGroup updates contact property group

type ComputedProperty

type ComputedProperty string

type Contact

type Contact struct {
	Vid          int        `json:"vid"`
	CanonicalVid int        `json:"canonical-vid"`
	MergedVids   []int      `json:"merged-vids"`
	PortalID     int        `json:"portal-id"`
	IsContact    bool       `json:"is-contact"`
	ProfileToken string     `json:"profile-token"`
	ProfileURL   string     `json:"profile-url"`
	Properties   Properties `json:"properties"`
}

type ContactDeleteResult

type ContactDeleteResult struct {
	VID     int    `json:"vid"`
	Deleted bool   `json:"deleted"`
	Reason  string `json:"reason"`
}

type ContactFilterItem

type ContactFilterItem struct {
	Operator         ContactOperator  `json:"operator"`
	Property         string           `json:"property"`
	ComputedProperty ComputedProperty `json:"computed_property"`
	Value            interface{}      `json:"value"`
	Type             string           `json:"type"`
}

type ContactList

type ContactList struct {
	ParentID       int      `json:"parentId"` // Integer, read-only; The ID of the folder that the list belongs to.  Currently folders can only be managed in the HubSpot app
	Dynamic        bool     `json:"dynamic"`
	Name           string   `json:"name"`
	Filters        Filters  `json:"filters"`
	PortalID       int      `json:"portalId"`
	CreatedAt      UnixTime `json:"createdAt"`
	ListID         int      `json:"listId"`
	UpdatedAt      UnixTime `json:"updatedAt"`
	InternalListID int      `json:"internalListId"`
	Deleteable     bool     `json:"deleteable"`
	Metadata       Metadata `json:"metaData"`
}

type ContactLists

type ContactLists struct {
	Lists []ContactList `json:"lists"`
	Page
}

type ContactListsService

type ContactListsService service

func (*ContactListsService) CreateContactList

func (s *ContactListsService) CreateContactList(name string) (*ContactList, error)

func (*ContactListsService) GetContactList

func (s *ContactListsService) GetContactList(listId int) (*ContactList, error)

func (*ContactListsService) GetContactLists

func (s *ContactListsService) GetContactLists() (*ContactLists, error)

type ContactOperator

type ContactOperator FilterOperator

type ContactPropertiesService

type ContactPropertiesService service

ContactPropertiesService - Contact properties are used to store specific information for each of your contact records

func (*ContactPropertiesService) Create

func (s *ContactPropertiesService) Create(property ItemProperty) (*ItemProperty, error)

Create create a contact property

func (*ContactPropertiesService) CreateGroup

CreateGroup creates a contact property group

func (*ContactPropertiesService) Delete

func (s *ContactPropertiesService) Delete(name string) error

Delete deletes a contact property by name

func (*ContactPropertiesService) DeleteGroup

func (s *ContactPropertiesService) DeleteGroup(name string) error

DeleteGroup deletes a contact property group

func (*ContactPropertiesService) GetAll

GetAll gets all contacts properties

func (*ContactPropertiesService) GetByName

func (s *ContactPropertiesService) GetByName(name string) (*ItemProperty, error)

GetByName gets property by name

func (*ContactPropertiesService) GetGroups

GetGroups gets all contacts property groups

func (*ContactPropertiesService) Update

func (s *ContactPropertiesService) Update(name string, update ItemProperty) (*ItemProperty, error)

Update updates an existing property by it name

func (*ContactPropertiesService) UpdateGroup

func (s *ContactPropertiesService) UpdateGroup(name string, update ItemPropertyGroup) (*ItemPropertyGroup, error)

UpdateGroup updates contact property group

type Contacts

type Contacts struct {
	Vid          int    `json:"vid"`
	CanonicalVid int    `json:"canonical-vid"`
	MergedVids   []int  `json:"merged-vids"`
	PortalID     int    `json:"portal-id"`
	IsContact    bool   `json:"is-contact"`
	ProfileToken string `json:"profile-token"`
	ProfileURL   string `json:"profile-url"`
	Property     Fields `json:"properties"`
}

type ContactsList

type ContactsList struct {
	Query    string      `json:"query"`
	Offset   int         `json:"offset"`
	HasMore  bool        `json:"has-more"`
	Total    int         `json:"total"`
	Contacts []*Contacts `json:"contacts"`
}

type ContactsService

type ContactsService service

func (*ContactsService) Create

func (s *ContactsService) Create(properties Properties) (*IdentityProfile, error)

func (*ContactsService) CreateOrUpdateByEmail

func (s *ContactsService) CreateOrUpdateByEmail(email string, properties Properties) (*Vid, error)

func (*ContactsService) DeleteByEmail

func (s *ContactsService) DeleteByEmail(email string) (*ContactDeleteResult, error)

func (*ContactsService) DeleteById

func (s *ContactsService) DeleteById(id int) (*ContactDeleteResult, error)

func (*ContactsService) GetByEmail

func (s *ContactsService) GetByEmail(email string) (*Contacts, error)

func (*ContactsService) GetByToken

func (s *ContactsService) GetByToken(token string) (*Contact, error)

func (*ContactsService) Merge

func (s *ContactsService) Merge(primaryID, secondaryID int) error

func (*ContactsService) SearchByQuery

func (s *ContactsService) SearchByQuery(query string, count int) (*ContactsList, error)

func (*ContactsService) Update

func (s *ContactsService) Update(contactID int, properties Properties) error

func (*ContactsService) UpdateByEmail

func (s *ContactsService) UpdateByEmail(email string, properties Properties) error

type Engagement

type Engagement struct {
	ID          int      `json:"id"`
	PortalID    int      `json:"portalId"`
	Active      bool     `json:"active"`
	CreatedAt   UnixTime `json:"createdAt"`
	LastUpdated UnixTime `json:"lastUpdated"`
	OwnerId     int      `json:"ownerId"`
	Type        string   `json:"type"`
	TimeStamp   UnixTime `json:"timestamp"`
}

type Engagements

type Engagements struct {
	Engagement   *Engagement   `json:"engagement"`
	Associations *Association  `json:"associations"`
	Attachments  []*Attachment `json:"attachments"`
	MetaData     *MetaData     `json:"metadata"`
}

type EngagementsService

type EngagementsService service

func (*EngagementsService) Create

func (s *EngagementsService) Create(body interface{}) (*Engagements, error)

type EventsFilterItem

type EventsFilterItem struct {
	Operator             EventsOpeerator `json:"operator"`
	EventID              int             `json:"value"`
	FirstOccurenceAfter  UnixTime        `json:"firstOccurrenceAfterTimestamp"`
	FirstOccurenceBefore UnixTime        `json:"firstOccurrenceBeforeTimestamp"`
	LastOccurenceAfter   UnixTime        `json:"lastOccurrenceAfterTimestamp"`
	LastOccurenceBefore  UnixTime        `json:"lastOccurrenceBeforeTimestamp"`
	MinOccurence         int             `json:"minOccurrences"`
	MaxOccurence         int             `json:"maxOccurrences"`
}

type EventsOpeerator

type EventsOpeerator FilterOperator

type Fields

type Fields struct {
	FirstName map[string]interface{} `json:"firstname"`
	LastName  map[string]interface{} `json:"lastname"`
	Website   map[string]interface{} `json:"website"`
	Company   map[string]interface{} `json:"company"`
	Phone     map[string]interface{} `json:"phone"`
	Address   map[string]interface{} `json:"address"`
	City      map[string]interface{} `json:"city"`
	State     map[string]interface{} `json:"state"`
	Zip       map[string]interface{} `json:"zip"`
}

type File

type File struct {
	Objects []Objects `json:"objects"`
}

type Filter

type Filter struct {
}

type FilterItem

type FilterItem struct {
	Operator FilterOperator
}

type FilterOperator

type FilterOperator string

type Filters

type Filters struct {
}

type FormService

type FormService struct {
	// contains filtered or unexported fields
}

FormService The Forms API's principle method is the submit form method, which allows you to pass any information captured on your website or application to HubSpot, including any custom data. This endpoint doesn't require authentication, so you can make the call from a form to our API from the client without needing to worry about insecurity.

func (*FormService) AddOption

func (s *FormService) AddOption(key, value string) *FormService

func (*FormService) AddOptions

func (s *FormService) AddOptions(data url.Values) *FormService

func (*FormService) SetHsContext

func (s *FormService) SetHsContext(context HsContext) *FormService

func (*FormService) SetHubspotCookie

func (s *FormService) SetHubspotCookie(cookie string) *FormService

func (*FormService) SetPageName

func (s *FormService) SetPageName(name string) *FormService

func (*FormService) SetPageUrl

func (s *FormService) SetPageUrl(url string) *FormService

func (*FormService) SetRemoteIpAddress

func (s *FormService) SetRemoteIpAddress(url string) *FormService

func (*FormService) SetReturnUrl

func (s *FormService) SetReturnUrl(url string) *FormService

func (*FormService) SubmitForm

func (s *FormService) SubmitForm(portalID int, formID string) error

type FormSubmissionFilterItem

type FormSubmissionFilterItem struct {
	Operator        FormSubmissionOperator `json:"operator"`
	FormID          int                    `json:"form"`
	PageID          int                    `json:"page"`
	AfterTimestamp  UnixTime               `json:"afterTimestamp"`
	Beforetimestamp UnixTime               `json:"beforeTimestamp"`
}

type FormSubmissionOperator

type FormSubmissionOperator FilterOperator

type HsContext

type HsContext struct {
	Hutk        string `json:"hutk"`
	IPAddress   string `json:"ipAddress"`
	PageURL     string `json:"pageUrl"`
	PageName    string `json:"pageName"`
	RedirectURL string `json:"redirectUrl"`
}

type HubspotClient

type HubspotClient struct {
	BaseURL     *url.URL
	UserAgent   string
	ContentType string
	// Services used for talking to different parts of the API
	ContactLists      *ContactListsService
	Contacts          *ContactsService
	ContactProperties *ContactPropertiesService
	CompanyProperties *CompanyPropertiesService
	Companies         *CompaniesService
	Forms             *FormService
	OAuths            *OAuthsService
	Tickets           *TicketsService
	CMSFiles          *CMSFilesService
	Engagements       *EngagementsService
	CRMAssociations   *CRMAssociationsService
	Owners            *OwnersService
	// contains filtered or unexported fields
}

func NewHubspotApiClient

func NewHubspotApiClient(apikey string) *HubspotClient

func NewHubspotClient

func NewHubspotClient(auth Authenticator) *HubspotClient

func NewHubspotOAuthClient

func NewHubspotOAuthClient(token string) *HubspotClient

func (*HubspotClient) Do

func (c *HubspotClient) Do(req *http.Request, v interface{}) error

Do sends an API request and returns the API response

func (*HubspotClient) Get

func (c *HubspotClient) Get(url string) (*http.Request, error)

Get creates a new GET API request

func (*HubspotClient) NewRequest

func (c *HubspotClient) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates a new API request.

func (*HubspotClient) Post

func (c *HubspotClient) Post(url string, body interface{}) (*http.Request, error)

Post creates a new POST request

func (*HubspotClient) RunDelete

func (c *HubspotClient) RunDelete(url string, res interface{}) error

func (*HubspotClient) RunGet

func (c *HubspotClient) RunGet(url string, res interface{}) error

func (*HubspotClient) RunPost

func (c *HubspotClient) RunPost(url string, body, res interface{}) error

func (*HubspotClient) RunPut

func (c *HubspotClient) RunPut(url string, body, res interface{}) error

type IdentityProfile

type IdentityProfile struct {
	Vid        int        `json:"vid"`
	Properties Properties `json:"properties"`
}

type ItemDataType

type ItemDataType string
const (
	String      ItemDataType = "string"
	Number      ItemDataType = "number"
	Date        ItemDataType = "date"
	DateTime    ItemDataType = "datetime"
	Enumeration ItemDataType = "enumeration"
)

type ItemFieldType

type ItemFieldType string
const (
	TextAreaField        ItemFieldType = "textarea"
	TextField            ItemFieldType = "text"
	DateField            ItemFieldType = "date"
	FileField            ItemFieldType = "file"
	NumberField          ItemFieldType = "number"
	SelectField          ItemFieldType = "select"
	RadioField           ItemFieldType = "radio"
	CheckboxField        ItemFieldType = "checkbox"
	BooleanCheckboxField ItemFieldType = "booleancheckbox"
)

type ItemProperties

type ItemProperties []ItemProperty

ItemProperties list of ItemProperty type

type ItemProperty

type ItemProperty struct {
	Name                          string               `json:"name"`
	Label                         string               `json:"label,omitempty"`
	Description                   string               `json:"description,omitempty"`
	DataType                      ItemDataType         `json:"type,omitempty"`
	FieldType                     ItemFieldType        `json:"fieldType,omitempty"`
	GroupName                     string               `json:"groupName,omitempty"`
	Options                       []ItemPropertyOption `json:"options"`
	Deleted                       bool                 `json:"deleted"`
	FormField                     bool                 `json:"formField"`
	DisplayOrder                  int                  `json:"displayOrder"`
	ReadOnlyValue                 bool                 `json:"readOnlyValue,omitempty"`
	ReadOnlyDefinition            bool                 `json:"readOnlyDefinition,omitempty"`
	Hidden                        bool                 `json:"hidden,omitempty"`
	MutableDefinitionNotDeletable bool                 `json:"mutableDefinitionNotDeletable,omitempty"`
	SearchableInGlobalSearch      bool                 `json:"searchableInGlobalSearch,omitempty"`
	Calculated                    bool                 `json:"calculated"`
	ExternalOptions               bool                 `json:"externalOptions"`
}

ItemProperty definition

type ItemPropertyGroup

type ItemPropertyGroup struct {
	Name           string `json:"name"`
	DisplayName    string `json:"displayName"`
	DisplayOrder   int    `json:"displayOrder"`
	HubspotDefined bool   `json:"hubspotDefined"`
}

ItemPropertyGroup item property group definition

type ItemPropertyGroups

type ItemPropertyGroups []ItemPropertyGroup

ItemPropertyGroups ItemPropertyGroup list type

type ItemPropertyOption

type ItemPropertyOption struct {
	Description  string      `json:"description"`
	Label        string      `json:"label"`
	DisplayOrder int         `json:"displayOrder"`
	Hidden       bool        `json:"hidden"`
	Value        interface{} `json:"value"`
}

ItemPropertyOption definition

type ListMembershipFilterItem

type ListMembershipFilterItem struct {
	Operator ListMembershipOperator `json:"operator"`
	ListID   int                    `json:"list"`
}

type ListMembershipOperator

type ListMembershipOperator FilterOperator

type MetaData

type MetaData struct {
	Body string `json:"body"`
}

type Metadata

type Metadata struct {
	Processing ProcessingType `json:"processing"`

	Size int `json:"size"`

	Error string `json:"error"`

	LastProcessingStateChangeAt UnixTime `json:"lastProcessingStateChangeAt"`

	LastSizeChangeAt UnixTime `json:"lastSizeChangeAt"`
}

type OAuth2

type OAuth2 struct {
	// contains filtered or unexported fields
}

OAuth2 OAuth 2 hubspot authenticator

func NewOAuth2

func NewOAuth2(token string) OAuth2

NewOAuth2 Create new instance of OAuth2

func (OAuth2) Authenticate

func (auth OAuth2) Authenticate(request *http.Request) error

Authenticate auth with OAuth2

type OAuthResponse

type OAuthResponse struct {
	AccessToken   string  `json:"access_token"`
	RefreshToken  string  `json:"refresh_token"`
	ExpiresIn     float64 `json:"expires_in"`
	TokenType     string  `json:"token_type"`
	Status        string  `json:"status"`
	Message       string  `json:"message"`
	CorrelationID string  `json:"correlationId"`
	RequestID     string  `json:"requestId"`
}

type OAuthsService

type OAuthsService service

func (*OAuthsService) GetByToken

func (s *OAuthsService) GetByToken(token string) (*TokenUser, error)

type Objects

type Objects struct {
	Id int `json:"id"`
}

type Owner

type Owner struct {
	PortalID                int          `json:"portalId"`
	OwnerId                 int          `json:"ownerId"`
	ActiveUserId            int          `json:"activeUserId"`
	UserIdIncludingInactive int          `json:"userIdIncludingInactive"`
	IsActive                bool         `json:"isActive"`
	HasContactsAccess       bool         `json:"hasContactsAccess"`
	Type                    string       `json:"type"`
	FirstName               string       `json:"firstName"`
	LastName                string       `json:"lastName"`
	Email                   string       `json:"email"`
	CreatedAt               UnixTime     `json:"createdAt"`
	UpdatedAt               UnixTime     `json:"updatedAt"`
	RemoteList              []RemoteList `json:"remoteList"`
}

type OwnersService

type OwnersService service

func (*OwnersService) GetOwnerById

func (s *OwnersService) GetOwnerById(id int) (*Owner, error)

func (*OwnersService) GetOwnersByEmail

func (s *OwnersService) GetOwnersByEmail(email string) ([]*Owner, error)

type Page

type Page struct {
	Offset  int  `json:"offset"`
	HasMore bool `json:"has-more"`
}

type PageViewFilterItem

type PageViewFilterItem struct {
	Operator             PageviewsOperator `json:"operator"`
	Value                string            `json:"value"`
	FirstOccurenceAfter  UnixTime          `json:"firstOccurrenceAfterTimestamp"`
	FirstOccurenceBefore UnixTime          `json:"firstOccurrenceBeforeTimestamp"`
	LastOccurenceAfter   UnixTime          `json:"lastOccurrenceAfterTimestamp"`
	LastOccurenceBefore  UnixTime          `json:"lastOccurrenceBeforeTimestamp"`
	MinOccurence         int               `json:"minOccurrences"`
	MaxOccurence         int               `json:"maxOccurrences"`
}

type PageviewsOperator

type PageviewsOperator FilterOperator

type ProcessingType

type ProcessingType string
const (
	DONE         ProcessingType = "DONE"
	REFRESHING   ProcessingType = "REFRESHING"
	INITIALIZING ProcessingType = "INITIALIZING"
	PROCESSING   ProcessingType = "PROCESSING"
)

type Properties

type Properties struct {
	Properties []Property `json:"properties"`
}

func (*Properties) AddProperty

func (p *Properties) AddProperty(prop string, value interface{})

AddProperty addes a new property to list

type Property

type Property struct {
	Property string      `json:"property"`
	Value    interface{} `json:"value"`
	Versions Versions    `json:"versions,omitempty"`
}

type RemoteList

type RemoteList struct {
	ID         int    `json:"id"`
	PortalID   int    `json:"portalId"`
	OwnerId    int    `json:"ownerId"`
	RemoteId   string `json:"remoteId"`
	RemoteType string `json:"remoteType"`
	Active     bool   `json:"active"`
}

type RequestCredentials

type RequestCredentials struct {
	AccessToken          string
	AccessTokenExpiresAt time.Time
	AccessTokenUpdating  sync.Mutex
}

type Settings

type Settings struct {
	ClientID           string
	ClientSecret       string
	AuthorizationCode  string
	RedirectURI        string
	Scopes             string
	RefreshToken       string
	RequestCredentials *RequestCredentials
}

func NewSettings

func NewSettings(clientID, clientSecret, redirectURI string, scopes []string) *Settings

func (*Settings) Authorization

func (s *Settings) Authorization() string

Authorization Request an authorization code The authorization code flow begins with the client directing the user to the /authorize endpoint.

https://legacydocs.hubspot.com/docs/methods/oauth2/initiate-oauth-integration

func (*Settings) InitializeCredentials

func (s *Settings) InitializeCredentials() error

func (*Settings) RefreshCredentials

func (s *Settings) RefreshCredentials() error

type Ticket

type Ticket struct {
	ObjectType string     `json:"objectType"`
	PortalID   int        `json:"portalId"`
	ObjectID   int        `json:"objectId"`
	IsDeleted  bool       `json:"isDeleted"`
	Properties Properties `json:"properties"`
}

type TicketsService

type TicketsService service

func (*TicketsService) Create

func (s *TicketsService) Create(body interface{}) (*Ticket, error)

type TokenUser

type TokenUser struct {
	Token     string   `json:"token"`
	UserEmail string   `json:"user"`
	HubDomain string   `json:"hub_domain"`
	Scopes    []string `json:"scopes"`
	HubID     int      `json:"hub_id"`
	AppID     int      `json:"app_id"`
	ExpiresIn float64  `json:"expires_in"`
	UserID    int      `json:"user_id"`
	TokenType string   `json:"token_type"`
}

type UnixTime

type UnixTime struct {
	time.Time
}

func (*UnixTime) MarshalJSON

func (t *UnixTime) MarshalJSON() ([]byte, error)

func (*UnixTime) String

func (t *UnixTime) String() string

func (*UnixTime) ToDate

func (t *UnixTime) ToDate()

func (*UnixTime) UnmarshalJSON

func (t *UnixTime) UnmarshalJSON(data []byte) error

type Version

type Version struct {
	Value       interface{} `json:"value"`
	SourceType  string      `json:"source-type"`
	SourceID    string      `json:"source-id"`
	SourceLabel string      `json:"source-label"`
	Timestamp   UnixTime    `json:"timestamp"`
	Selected    bool        `json:"selected"`
}

type Versions

type Versions []Version

type Vid

type Vid struct {
	VID   int  `json:"vid"`
	IsNew bool `json:"isNew"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL