Skip to content

Commit

Permalink
Add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmuller committed Oct 28, 2021
1 parent 67acb15 commit 9c7dd24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions zendesk/group_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions zendesk/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions zendesk/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ type (
// Restriction Restriction
}

// ViewAPI encapsulates methods on view
ViewAPI interface {
GetView(context.Context, int64) (View, error)
GetViews(context.Context) ([]View, Page, error)
GetTicketsFromView(context.Context, int64) ([]Ticket, error)
}
)

// 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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 9c7dd24

Please sign in to comment.