hubspotclient

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRefreshToken

func GetRefreshToken(ctx context.Context, clientID, clientSecret string, port int) (string, error)

Types

type CompaniesResponse

type CompaniesResponse struct {
	Results []Company `json:"results"`
	Paging  Paging    `json:"paging"`
}

type Company

type Company struct {
	ID         string            `json:"id"`
	CreatedAt  time.Time         `json:"createdAt"`
	UpdatedAt  time.Time         `json:"updatedAt"`
	Properties CompanyProperties `json:"properties"`
}

type CompanyProperties

type CompanyProperties struct {
	City              string `json:"city"`
	Domain            string `json:"domain"`
	Industry          string `json:"industry"`
	Name              string `json:"name"`
	Phone             string `json:"phone"`
	State             string `json:"state"`
	LICompanyPage     string `json:"linkedin_company_page"`
	NumberOfEmployees string `json:"numberofemployees"`
	AnnualRevenue     string `json:"annualrevenue"`
	OriginalSource    string `json:"hs_analytics_source"`
}

type Contact

type Contact struct {
	ID         string     `json:"id"`
	Properties Properties `json:"properties"`
	CreatedAt  time.Time  `json:"createdAt"`
	UpdatedAt  time.Time  `json:"updatedAt"`
}

type ContactResponse

type ContactResponse struct {
	Results []Contact `json:"results"`
	Paging  Paging    `json:"paging"`
}

type HubspotClient

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

func NewHubspotClient

func NewHubspotClient(ctx context.Context, privateAccessToken string) (*HubspotClient, error)

func NewHubspotOAuth2Client

func NewHubspotOAuth2Client(ctx context.Context, clientID, clientSecret, refreshToken string) (*HubspotClient, error)

func (*HubspotClient) ListCompanies

func (c *HubspotClient) ListCompanies() ([]Company, error)

func (*HubspotClient) ListContacts

func (c *HubspotClient) ListContacts() ([]Contact, error)

func (*HubspotClient) ListUsers

func (c *HubspotClient) ListUsers() ([]User, error)

func (*HubspotClient) LookupCompany

func (c *HubspotClient) LookupCompany(name string) Company

func (*HubspotClient) LookupUser

func (c *HubspotClient) LookupUser(id string) string

type Paging

type Paging struct {
	Next struct {
		After string `json:"after"`
	} `json:"next"`
}

type Properties

type Properties struct {
	FirstName             string `json:"firstname"`
	LastName              string `json:"lastname"`
	Email                 string `json:"email"`
	Company               string `json:"company"`
	Owner                 string `json:"hubspot_owner_id"`
	Phone                 string `json:"phone"`
	DeveloperSetup        string `json:"developer_setup"`
	Domain                string `json:"hs_email_domain"`
	Title                 string `json:"jobtitle"`
	OriginalSource        string `json:"hs_analytics_source"`
	OriginalSourceData2   string `json:"hs_analytics_source_data_2"`
	CreatedAccount        string `json:"created_account"`
	CreatedOrganization   string `json:"created_organization"`
	InvitedToOrganization string `json:"invited_to"`
	FirstConversion       string `json:"first_conversion_event_name"`
	RecentConversion      string `json:"recent_conversion_event_name"`
}

type User

type User struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type UsersResponse

type UsersResponse struct {
	Results []User `json:"results"`
	Paging  Paging `json:"paging"`
}

Jump to

Keyboard shortcuts

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