Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make UpdateUserGroupMembers arguments to be more consistent #1173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions usergroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,19 @@ func (api *Client) GetUserGroupMembersContext(ctx context.Context, userGroup str
}

// UpdateUserGroupMembers will update the members of an existing user group
func (api *Client) UpdateUserGroupMembers(userGroup string, members string) (UserGroup, error) {
func (api *Client) UpdateUserGroupMembers(userGroup string, members []string) (UserGroup, error) {
return api.UpdateUserGroupMembersContext(context.Background(), userGroup, members)
}

// UpdateUserGroupMembersContext will update the members of an existing user group with a custom context
func (api *Client) UpdateUserGroupMembersContext(ctx context.Context, userGroup string, members string) (UserGroup, error) {
func (api *Client) UpdateUserGroupMembersContext(ctx context.Context, userGroup string, members []string) (UserGroup, error) {
// A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
users := strings.Join(members, ",")

values := url.Values{
"token": {api.token},
"usergroup": {userGroup},
"users": {members},
"users": {users},
}

response, err := api.userGroupRequest(ctx, "usergroups.users.update", values)
Expand Down