Documentation ¶
Index ¶
- Constants
- Variables
- type CRMError
- type CRMResponseError
- type Connector
- func (c *Connector) Delete(ctx context.Context, config common.DeleteParams) (*common.DeleteResult, error)
- 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() providers.Provider
- func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)
- func (c *Connector) String() string
- func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)
- type EnhancedCRMError
- type Option
Constants ¶
const (
// DefaultPageSize is number of elements per page.
DefaultPageSize = 100
)
const UnderscoreFieldFormat = "_%v_value"
UnderscoreFieldFormat is used to format field names that will be present in Read response. These fields are references used for search.
Variables ¶
var ( ErrObjectNotFound = errors.New("object not found") ErrObjectMissingAttributes = errors.New("object missing metadata attributes") )
Functions ¶
This section is empty.
Types ¶
type CRMError ¶
type CRMError struct { Code string `json:"code"` Message string `json:"message"` *EnhancedCRMError }
type CRMResponseError ¶
type CRMResponseError struct {
Err CRMError `json:"error"`
}
func (CRMResponseError) CombineErr ¶
func (r CRMResponseError) CombineErr(base error) error
type Connector ¶
type Connector struct { BaseURL string Client *common.JSONHTTPClient }
func NewConnector ¶
func (*Connector) Delete ¶
func (c *Connector) Delete(ctx context.Context, config common.DeleteParams) (*common.DeleteResult, error)
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 list of fields that can be queried during Read operation. The searched object will be considered not found by returning ErrObjectNotFound error. This will happen if API calls for schema/attributes fail. In an unlikely event it may happen if MS server's response format would change.
func (*Connector) Read ¶
func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)
nolint:lll Microsoft API supports other capabilities like filtering, grouping, and sorting which we can potentially tap into later. See https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api#odata-query-options
func (*Connector) Write ¶
func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)
Write data will be used to Create or Update entity. Return: common.WriteResult, where only the Success flag will be set.
type EnhancedCRMError ¶
type Option ¶
type Option = func(params *parameters)
Option is a function which mutates the connector configuration.
func WithAuthenticatedClient ¶
func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option