Documentation
¶
Overview ¶
Package crm implements HubSpot CRM API requests using a portal access token.
Index ¶
- Constants
- func IsCustomObjectTypeID(objectType string) bool
- func IsStandardObject(objectType string) bool
- type AccountDetails
- type Client
- func (c *Client) AccountDetails(ctx context.Context) (*AccountDetails, error)
- func (c *Client) Close() error
- func (c *Client) List(ctx context.Context, req ListRequest) (*Page, error)
- func (c *Client) ListCustomObjectSchemas(ctx context.Context) ([]CustomObjectSchema, error)
- func (c *Client) ListCustomObjectSchemasBounded(ctx context.Context, maxBytes int64) ([]CustomObjectSchema, error)
- func (c *Client) ListProperties(ctx context.Context, objectType string) ([]Property, error)
- func (c *Client) ListPropertiesBounded(ctx context.Context, objectType string, maxBytes int64) ([]Property, error)
- func (c *Client) Search(ctx context.Context, req SearchRequest) (*Page, error)
- func (c *Client) Upsert(ctx context.Context, req UpsertRequest) (*UpsertResult, error)
- type Config
- type CustomObjectSchema
- type Filter
- type FilterGroup
- type ListRequest
- type Object
- type Page
- type Property
- type Record
- type SearchRequest
- type UpsertInput
- type UpsertRecord
- type UpsertRequest
- type UpsertResult
Constants ¶
View Source
const ( AccountMetadataPath = "/account-info/v3/details" ContactPropertiesPath = "/crm/properties/" + supportedAPIVersion + "/contacts" )
View Source
const (
MaxBatchUpsertInputs = 100
)
Variables ¶
This section is empty.
Functions ¶
func IsCustomObjectTypeID ¶
func IsStandardObject ¶
Types ¶
type AccountDetails ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New validates the access token and base URL, then creates an SSRF-protected transport when private hosts are disabled.
func (*Client) AccountDetails ¶
func (c *Client) AccountDetails(ctx context.Context) (*AccountDetails, error)
func (*Client) ListCustomObjectSchemas ¶
func (c *Client) ListCustomObjectSchemas(ctx context.Context) ([]CustomObjectSchema, error)
func (*Client) ListCustomObjectSchemasBounded ¶
func (c *Client) ListCustomObjectSchemasBounded( ctx context.Context, maxBytes int64, ) ([]CustomObjectSchema, error)
ListCustomObjectSchemasBounded retrieves account-defined object schemas and their property definitions under the caller's response-size budget.
func (*Client) ListProperties ¶
func (*Client) ListPropertiesBounded ¶
func (c *Client) ListPropertiesBounded(ctx context.Context, objectType string, maxBytes int64) ([]Property, error)
ListPropertiesBounded lists schema properties while limiting the provider response before decoding it into an in-memory property slice.
func (*Client) Upsert ¶
func (c *Client) Upsert(ctx context.Context, req UpsertRequest) (*UpsertResult, error)
type CustomObjectSchema ¶
type FilterGroup ¶
type FilterGroup struct {
Filters []Filter
}
type ListRequest ¶
type Object ¶
func SupportedObjects ¶
func SupportedObjects() []Object
type Property ¶
type Property struct {
Name string `json:"name"`
Label string `json:"label"`
Type string `json:"type"`
HasUniqueValue bool `json:"has_unique_value,omitempty"`
ReadOnlyValue bool `json:"read_only_value,omitempty"`
}
func ReadContactMetadata ¶
func ReadContactMetadata(ctx context.Context, transport *http.Client, accessToken string, accountID, maxBytes int64) ([]Property, error)
ReadContactMetadata uses the caller's restricted HTTP client and fixed provider endpoint. Account identity is checked before reading properties.
type SearchRequest ¶
type UpsertInput ¶
type UpsertRecord ¶
type UpsertRequest ¶
type UpsertRequest struct {
ObjectType string
Inputs []UpsertInput
MaxResponseBytes int64
}
type UpsertResult ¶
type UpsertResult struct {
Records []UpsertRecord
}
Click to show internal directories.
Click to hide internal directories.