Class: BrickFTP::RESTfulAPI::AddGroupMember
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::AddGroupMember
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/add_group_member.rb
Overview
Add a member
Params
PARAMETER | TYPE | DESCRIPTION |
---|---|---|
admin | boolean | Indicates whether the user is an administrator of the group. |
Defined Under Namespace
Classes: Params
Instance Method Summary collapse
-
#call(group_id, user_id, params) ⇒ BrickFTP::Types::GroupMembership
Adds a user to a group.
Methods included from Command
Instance Method Details
#call(group_id, user_id, params) ⇒ BrickFTP::Types::GroupMembership
Adds a user to a group.
- By default, the member will not be an admin.
- If the user is already a member of the group, their attributes will be updated to match the request.
37 38 39 40 41 |
# File 'lib/brick_ftp/restful_api/add_group_member.rb', line 37 def call(group_id, user_id, params) res = client.put("/api/rest/v1/groups/#{group_id}/memberships/#{user_id}.json", membership: params.to_h.compact) BrickFTP::Types::GroupMembership.new(**res.symbolize_keys) end |