Documentation
¶
Index ¶
- func WrapError(err error, message string) error
- type APIError
- type AssociationResult
- type AssociationResults
- type Client
- func (c *Client) FindMany(ctx context.Context, dataType DataType, currentToken *oauth2.Token, ...) ([]*Result, error)
- func (c *Client) FindOne(ctx context.Context, dataType DataType, currentToken *oauth2.Token, id string, ...) (*Result, error)
- func (c *Client) GetAPIURL(path ...string) string
- func (c *Client) GetRequest(ctx context.Context) *resty.Request
- func (c *Client) GetRequestWithBearerAuth(ctx context.Context, token string) *resty.Request
- func (c *Client) GetToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
- type DataType
- type ErrorResponse
- type FindManyParams
- type FindOneParams
- type InitClient
- type ManyResponse
- type OneResponse
- type Paging
- type PagingNext
- type PagingPrev
- type Result
- type TokenRefreshCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
Code int `json:"code"`
Message string `json:"message"`
Type string `json:"type"`
}
APIError holds message and statusCode for api errors
type AssociationResult ¶
type AssociationResults ¶
type AssociationResults struct {
Results []AssociationResult `json:"results"`
}
type Client ¶
type Client struct {
Server string
// Doer for performing requests
RestyClient *resty.Client
OauthConfig *oauth2.Config
OauthToken *oauth2.Token
// Function called, when a token is fetched or refreshed so the using library can store the new refresh_token for furure use. The optional ClientIdentifier, for the using library to know which client called the function
// Returns
// error - any errors the Function passed in returned
TokenRefreshCallback TokenRefreshCallback
ClientIdetifier *string
}
func NewClient ¶
func NewClient(oauthConfig *oauth2.Config, oAuthToken *oauth2.Token, clientIdentifier *string, tokenRefreshCallback TokenRefreshCallback) *Client
Creates a new Client, with reasonable defaults
func (*Client) GetRequest ¶
GetRequest returns a request for calling endpoints.
func (*Client) GetRequestWithBearerAuth ¶
type ErrorResponse ¶
type ErrorResponse struct {
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
CorrelationId string `json:"correlationId,omitempty"`
Category string `json:"category,omitempty"`
}
ErrorResponse is a model of an error response
func (ErrorResponse) NotEmpty ¶
func (e ErrorResponse) NotEmpty() bool
NotEmpty validates that error is not emptyp
func (ErrorResponse) String ¶
func (e ErrorResponse) String() string
String returns a string representation of an error
type FindManyParams ¶
type FindManyParams struct {
After *string `json:"after,omitempty" url:"after,omitempty"`
Archived *bool `json:"archived,string,omitempty" json:"url,string,omitempty"`
Associations *[]string `json:"associations,omitempty" url:"associations,omitempty"`
Limit *int `json:"limit,string,omitempty" json:"url,string,omitempty"`
Properties *[]string `json:"properties,omitempty" url:"properties,omitempty"`
PropertiesWithHistory *[]string `json:"propertiesWithHistory,omitempty" url:"propertiesWithHistory,omitempty"`
}
type FindOneParams ¶
type FindOneParams struct {
Archived *bool `json:"archived,omitempty" url:"archived,omitempty"`
Associations *[]string `json:"associations,omitempty" url:"associations,omitempty"`
IdProperty *string `json:"idProperty,omitempty" url:"idProperty,omitempty"`
Properties *[]string `json:"properties,omitempty" url:"properties,omitempty"`
PropertiesWithHistory *[]string `json:"propertiesWithHistory,omitempty" url:"propertiesWithHistory,omitempty"`
}
type InitClient ¶
func NewInitClient ¶
func NewInitClient(oauthConfig *oauth2.Config) *InitClient
Creates a new Client, with reasonable defaults
func (*InitClient) ExchangeInitialCode ¶
type ManyResponse ¶
type OneResponse ¶
type OneResponse = Result
type Paging ¶
type Paging struct {
Next PagingNext `json:"next"`
Prev PagingPrev `json:"prev"`
}
type PagingNext ¶
type PagingPrev ¶
type Result ¶
type Result struct {
Archived bool `json:"archived"`
CreatedAt string `json:"createdAt"`
Id string `json:"id"`
Properties map[string]string `json:"properties"`
UpdatedAt string `json:"updatedAt"`
ArchivedAt string `json:"archivedAt"`
Associations map[string]AssociationResults `json:"associations"`
ObjectWriteTraceId string `json:"objectWriteTraceId"`
PropertiesWithHistory map[string]string `json:"propertiesWithHistory"`
Url string `json:"url"`
}
Click to show internal directories.
Click to hide internal directories.