From 9c7dd24222f97ec64a0a0a6ab09e8929dba57607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20C=2E=20M=C3=BCller?= Date: Thu, 28 Oct 2021 11:42:54 -0400 Subject: [PATCH] Add missing docs --- zendesk/group_membership.go | 3 +++ zendesk/user.go | 1 + zendesk/view.go | 7 ++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zendesk/group_membership.go b/zendesk/group_membership.go index ad4d920..590d0d7 100644 --- a/zendesk/group_membership.go +++ b/zendesk/group_membership.go @@ -20,12 +20,15 @@ type ( UpdatedAt time.Time `json:"updated_at,omitempty"` } + // GroupMembershipListOptions is a struct for options for group membership list + // ref: https://developer.zendesk.com/api-reference/ticketing/groups/group_memberships/ GroupMembershipListOptions struct { PageOptions GroupID int64 `json:"group_id,omitempty" url:"group_id,omitempty"` UserID int64 `json:"user_id,omitempty" url:"user_id,omitempty"` } + // GroupMembershipAPI is an interface containing group membership related methods GroupMembershipAPI interface { GetGroupMemberships(context.Context, *GroupMembershipListOptions) ([]GroupMembership, Page, error) } diff --git a/zendesk/user.go b/zendesk/user.go index f116d24..1e62eda 100644 --- a/zendesk/user.go +++ b/zendesk/user.go @@ -7,6 +7,7 @@ import ( "time" ) +// UserFields is a dictionary of custom user related fields type UserFields map[string]interface{} // User is zendesk user JSON payload format diff --git a/zendesk/view.go b/zendesk/view.go index c92bb39..86be3ed 100644 --- a/zendesk/view.go +++ b/zendesk/view.go @@ -24,6 +24,7 @@ type ( // Restriction Restriction } + // ViewAPI encapsulates methods on view ViewAPI interface { GetView(context.Context, int64) (View, error) GetViews(context.Context) ([]View, Page, error) @@ -31,7 +32,7 @@ type ( } ) -// GetViews gets the memberships of the specified group +// GetViews gets all views // ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#list-views func (z *Client) GetViews(ctx context.Context) ([]View, Page, error) { var result struct { @@ -52,7 +53,7 @@ func (z *Client) GetViews(ctx context.Context) ([]View, Page, error) { return result.Views, result.Page, nil } -// GetView gets the memberships of the specified group +// GetView gets a given view // ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#show-view func (z *Client) GetView(ctx context.Context, viewID int64) (View, error) { var result struct { @@ -72,7 +73,7 @@ func (z *Client) GetView(ctx context.Context, viewID int64) (View, error) { return result.View, nil } -// GetView gets the memberships of the specified group +// GetTicketsFromView gets the tickets of the specified view // ref: https://developer.zendesk.com/api-reference/ticketing/business-rules/views/#list-tickets-from-a-view func (z *Client) GetTicketsFromView(ctx context.Context, viewID int64) ([]Ticket, error) { var result struct {