Documentation ¶
Index ¶
- Constants
- Variables
- type Connector
- func (c *Connector) HTTPClient() *common.HTTPClient
- func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient
- func (c *Connector) ListObjectMetadata(ctx context.Context, objectNames []string) (*common.ListObjectMetadataResult, error)
- func (c *Connector) Provider() string
- func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)
- func (c *Connector) Search(ctx context.Context, config SearchParams) (*common.ReadResult, error)
- func (c *Connector) String() string
- func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)
- type Filter
- type Option
- type Query
- type SearchParams
Constants ¶
const ( TypeQueryKey = "type" ObjectTypeQueryKey = "object_type" FieldQueryKey = "field" FieldNameTypeQueryKey = "field_name" ConditionQueryKey = "condition" ValueQueryKey = "value" WhichQueryKey = "which" OnOrAfterQueryKey = "on_or_after" )
nolint:gochecknoglobals
Variables ¶
var ErrSkipFailure = errors.New("error: failed to create next page url")
ErrSkipFailure is an error genarated when we fails to construct the next page url.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct { BaseURL string Client *common.JSONHTTPClient }
Connector is a Close connector.
func NewConnector ¶
NewConnector returns a new Close connector.
func (*Connector) HTTPClient ¶
func (c *Connector) HTTPClient() *common.HTTPClient
func (*Connector) JSONHTTPClient ¶
func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient
JSONHTTPClient returns the underlying JSON HTTP client.
func (*Connector) ListObjectMetadata ¶
func (c *Connector) ListObjectMetadata(ctx context.Context, objectNames []string, ) (*common.ListObjectMetadataResult, error)
ListObjectMetadata returns object metadata for each object name provided.
func (*Connector) Read ¶
func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)
Read retrieves data based on the provided read parameters. ref: https://developer.close.com/resources/leads
func (*Connector) Search ¶
func (c *Connector) Search(ctx context.Context, config SearchParams) (*common.ReadResult, error)
Search reads data through searching API. Supports advanced filtering using the filters field. The NextPage Token generated takes 30 seconds to expire.
doc: https://developer.close.com/resources/advanced-filtering
func (*Connector) Write ¶
func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)
Write creates/updates records in CloseCRM.
doc: https://developer.close.com/resources/leads/#create-a-new-lead
type Option ¶
type Option = func(params *parameters)
Option is a function which mutates the close connector configuration.
func WithAuthenticatedClient ¶
func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option
WithAuthenticatedClient sets the http client to use for the connector. Its usage is optional.