Class: BrickFTP::RESTfulAPI::UpdateGroupMember

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/brick_ftp/restful_api/update_group_member.rb

Overview

Update a member

Params

PARAMETER TYPE DESCRIPTION
admin boolean Indicates whether the user is an administrator of the group.

See Also:

Defined Under Namespace

Classes: Params

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#call(group_id, user_id, params) ⇒ BrickFTP::Types::GroupMembership

Updates a user's group membership. No action will be taken if the user is not already in the group.

Parameters:

Returns:



33
34
35
36
37
# File 'lib/brick_ftp/restful_api/update_group_member.rb', line 33

def call(group_id, user_id, params)
  res = client.patch("/api/rest/v1/groups/#{group_id}/memberships/#{user_id}.json", membership: params.to_h.compact)

  BrickFTP::Types::GroupMembership.new(**res.symbolize_keys)
end