Skip to content

Commit

Permalink
feature: add merge-end-users method to user client (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfleming authored Jun 22, 2021
1 parent 6e9d931 commit ec5e065
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zendesk/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,13 @@ func (c *client) ShowComplianceDeletionStatuses(id int64) ([]ComplianceDeletionS
out)
return out.ComplianceDeletionStatuses, err
}

// Merges the end user specified in the path parameter into the existing end user specified in the request body.
//
// Zendesk Core API docs: https://developer.zendesk.com/rest_api/docs/support/users#merge-end-users
func (c *client) MergeEndUsers(toMergeUserId int64, intoUser *User) (*User, error) {
in := &APIPayload{User: intoUser}
out := new(APIPayload)
err := c.put(fmt.Sprintf("/api/v2/users/%d/merge.json", toMergeUserId), in, out)
return out.User, err
}
1 change: 1 addition & 0 deletions zendesk/zendesk.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type Client interface {
ListUsers(*ListUsersOptions) ([]User, error)
ListGroups() ([]Group, error)
MakeIdentityPrimary(int64, int64) ([]UserIdentity, error)
MergeEndUsers(int64, *User) (*User, error)
PermanentlyDeleteTicket(int64) (*JobStatus, error)
PermanentlyDeleteUser(int64) (*User, error)
RedactCommentString(int64, int64, string) (*TicketComment, error)
Expand Down

0 comments on commit ec5e065

Please # to comment.