Class: Code42::User
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#assign_role(attrs = {}) ⇒ Code42::Role
Assigns a role to this user.
- #block ⇒ Object
- #delete ⇒ Object
-
#org ⇒ Code42::User
Returns the org associated with this user.
-
#roles ⇒ Code42::RoleCollection
Returns the roles associated with this user.
- #unblock ⇒ Object
Methods inherited from Resource
attribute, collection_from_response, deserialize, deserialize_and_initialize, from_response, #initialize, serialize, #serialize, serializer
Constructor Details
This class inherits a constructor from Code42::Resource
Class Method Details
.create(attributes) ⇒ Object
13 14 15 |
# File 'lib/code42/user.rb', line 13 def self.create(attributes) client.create_user(attributes) end |
Instance Method Details
#assign_role(attrs = {}) ⇒ Code42::Role
Assigns a role to this user
35 36 37 38 |
# File 'lib/code42/user.rb', line 35 def assign_role(attrs = {}) attrs.merge!(user_id: id) client.assign_role(attrs) end |
#block ⇒ Object
40 41 42 |
# File 'lib/code42/user.rb', line 40 def block client.block_user(user_id: id) end |
#delete ⇒ Object
17 18 19 |
# File 'lib/code42/user.rb', line 17 def delete client.delete_user(id) end |
#org ⇒ Code42::User
Returns the org associated with this user
23 24 25 |
# File 'lib/code42/user.rb', line 23 def org client.org(org_id) end |
#roles ⇒ Code42::RoleCollection
Returns the roles associated with this user
29 30 31 |
# File 'lib/code42/user.rb', line 29 def roles client.user_roles(id) end |
#unblock ⇒ Object
44 45 46 |
# File 'lib/code42/user.rb', line 44 def unblock client.unblock_user(user_id: id) end |