Documentation ¶
Index ¶
- type Client
- func (c *Client) GetOrganization(ctx context.Context, id int) (output *model.Organization, err error)
- func (c *Client) GetTickets(ctx context.Context) (output []*model.Ticket, err error)
- func (c *Client) GetTrigger(ctx context.Context, id int) (output *model.Trigger, err error)
- func (c *Client) GetTriggers(ctx context.Context) (output []*model.Trigger, err error)
- func (c *Client) GetUser(ctx context.Context, id string) (output *model.User, err error)
- func (c *Client) GetView(ctx context.Context, viewID int) (view *model.View, err error)
- func (c *Client) GetViewCount(ctx context.Context, viewID int) (viewCount *model.ViewCount, err error)
- func (c *Client) GetViews(ctx context.Context) ([]*model.View, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the instance of the Zendesk API wrapper client from go-zendesk/zendesk, as well as the configuration for connecting to Zendesk.
func Connect ¶
func Connect(config *model.ZendeskConfigInput) *Client
Connect takes a configuration for Zendesk and uses it to create a new instance of a Zendesk client. c is then used as a receiver for any other interaction with Zendesk, as it's preconfigured, and contains an http.Client
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(ctx context.Context, id int) (output *model.Organization, err error)
GetOrganization takes the client, c, and requests the details for the organization provided by the context to the Zendesk API wrapper. Once it retreives that data from Zendesk, it converts the output into a model. Organization.
func (*Client) GetTickets ¶
GetTickets uses the preconfigured client, c, and sends a request for all tickets to the Zendesk API wrapper, asking it to sort tickets by last updated. Once it grabs the array of tickets, it makes sure that any pagination is handled, and converts the ticket output into an array of model. Ticket.
func (*Client) GetTrigger ¶
GetTrigger uses the preconfigured client, c, and sends a request for all triggers to the Zendesk API wrapper. Once it grabs the specified trigger, it converts the output into a type of model.Trigger.
func (*Client) GetTriggers ¶
GetTriggers uses the preconfigured client, c, and sends a request for all triggers to the Zendesk API wrapper. Once it grabs the array of triggers, it makes sure that any pagination is handled, and converts the ticket output into an array of model.Trigger.
func (*Client) GetUser ¶
GetUser takes the client, c, and requests the details for the user provided by the context to the Zendesk API wrapper. Once it retreives that data from Zendesk, it converts the output into a model. user.
func (*Client) GetView ¶
GetView takes the client, c, and a View ID, and pulls the details for a specific view