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
- #update(attributes) ⇒ 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
39 40 41 42 |
# File 'lib/code42/user.rb', line 39 def assign_role(attrs = {}) attrs.merge!(user_id: id) client.assign_role(attrs) end |
#block ⇒ Object
44 45 46 |
# File 'lib/code42/user.rb', line 44 def block client.block_user(user_id: id) end |
#delete ⇒ Object
21 22 23 |
# File 'lib/code42/user.rb', line 21 def delete client.delete_user(id) end |
#org ⇒ Code42::User
Returns the org associated with this user
27 28 29 |
# File 'lib/code42/user.rb', line 27 def org client.org(org_id) end |
#roles ⇒ Code42::RoleCollection
Returns the roles associated with this user
33 34 35 |
# File 'lib/code42/user.rb', line 33 def roles client.user_roles(id) end |
#unblock ⇒ Object
48 49 50 |
# File 'lib/code42/user.rb', line 48 def unblock client.unblock_user(user_id: id) end |
#update(attributes) ⇒ Object
17 18 19 |
# File 'lib/code42/user.rb', line 17 def update(attributes) client.update_user(id, attributes) end |