Class: WorkOS::DirectoryUserWithGroups
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::DirectoryUserWithGroups
- Defined in:
- lib/workos/directory_sync/directory_user_with_groups.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, directory_id: :directory_id, organization_id: :organization_id, idp_id: :idp_id, email: :email, first_name: :first_name, last_name: :last_name, emails: :emails, job_title: :job_title, username: :username, state: :state, raw_attributes: :raw_attributes, custom_attributes: :custom_attributes, role: :role, roles: :roles, created_at: :created_at, updated_at: :updated_at, groups: :groups }.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
-
#directory_id ⇒ Object
Returns the value of attribute directory_id.
-
#email ⇒ Object
Returns the value of attribute email.
-
#emails ⇒ Object
deprecated
Deprecated.
A list of email addresses for the user.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#id ⇒ Object
Returns the value of attribute id.
-
#idp_id ⇒ Object
Returns the value of attribute idp_id.
-
#job_title ⇒ Object
deprecated
Deprecated.
The job title of the user.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#raw_attributes ⇒ Object
deprecated
Deprecated.
The raw attributes received from the directory provider.
-
#role ⇒ Object
Returns the value of attribute role.
-
#roles ⇒ Object
Returns the value of attribute roles.
-
#state ⇒ Object
Returns the value of attribute state.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#username ⇒ Object
deprecated
Deprecated.
The username of the user.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ DirectoryUserWithGroups
constructor
A new instance of DirectoryUserWithGroups.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ DirectoryUserWithGroups
Returns a new instance of DirectoryUserWithGroups.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 83 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] @directory_id = hash[:directory_id] @organization_id = hash[:organization_id] @idp_id = hash[:idp_id] @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserWithGroupsEmail.new(item) : nil } @job_title = hash[:job_title] @username = hash[:username] @state = hash[:state] @raw_attributes = hash[:raw_attributes] || {} @custom_attributes = hash[:custom_attributes] || {} @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } @created_at = hash[:created_at] @updated_at = hash[:updated_at] @groups = (hash[:groups] || []).map { |item| item ? WorkOS::DirectoryGroup.new(item) : nil } end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def created_at @created_at end |
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def custom_attributes @custom_attributes end |
#directory_id ⇒ Object
Returns the value of attribute directory_id.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def directory_id @directory_id end |
#email ⇒ Object
Returns the value of attribute email.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def email @email end |
#emails ⇒ Object
A list of email addresses for the user.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at, :groups |
#first_name ⇒ Object
Returns the value of attribute first_name.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def first_name @first_name end |
#groups ⇒ Object
Returns the value of attribute groups.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def groups @groups end |
#id ⇒ Object
Returns the value of attribute id.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def id @id end |
#idp_id ⇒ Object
Returns the value of attribute idp_id.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def idp_id @idp_id end |
#job_title ⇒ Object
The job title of the user.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at, :groups |
#last_name ⇒ Object
Returns the value of attribute last_name.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def last_name @last_name end |
#object ⇒ Object
Returns the value of attribute object.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def object @object end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def organization_id @organization_id end |
#raw_attributes ⇒ Object
The raw attributes received from the directory provider.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at, :groups |
#role ⇒ Object
Returns the value of attribute role.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def role @role end |
#roles ⇒ Object
Returns the value of attribute roles.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def roles @roles end |
#state ⇒ Object
Returns the value of attribute state.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def state @state end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
38 39 40 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 def updated_at @updated_at end |
#username ⇒ Object
The username of the user.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 38 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at, :groups |