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, name: :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
deprecated
Deprecated.
The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a
userfilter to fetch a user's group memberships. -
#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.
-
#name ⇒ Object
Returns the value of attribute 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.
Instance Method Summary collapse
-
#initialize(json) ⇒ DirectoryUserWithGroups
constructor
A new instance of DirectoryUserWithGroups.
Constructor Details
#initialize(json) ⇒ DirectoryUserWithGroups
Returns a new instance of DirectoryUserWithGroups.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 93 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] @name = hash[: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.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def created_at @created_at end |
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def custom_attributes @custom_attributes end |
#directory_id ⇒ Object
Returns the value of attribute directory_id.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def directory_id @directory_id end |
#email ⇒ Object
Returns the value of attribute email.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def email @email end |
#emails ⇒ Object
A list of email addresses for the user.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at |
#first_name ⇒ Object
Returns the value of attribute first_name.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def first_name @first_name end |
#groups ⇒ Object
The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a user filter to fetch a user's group memberships.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at |
#id ⇒ Object
Returns the value of attribute id.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def id @id end |
#idp_id ⇒ Object
Returns the value of attribute idp_id.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def idp_id @idp_id end |
#job_title ⇒ Object
The job title of the user.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at |
#last_name ⇒ Object
Returns the value of attribute last_name.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def last_name @last_name end |
#name ⇒ Object
Returns the value of attribute name.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def object @object end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def organization_id @organization_id end |
#raw_attributes ⇒ Object
The raw attributes received from the directory provider.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at |
#role ⇒ Object
Returns the value of attribute role.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def role @role end |
#roles ⇒ Object
Returns the value of attribute roles.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def roles @roles end |
#state ⇒ Object
Returns the value of attribute state.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def state @state end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
41 42 43 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 def updated_at @updated_at end |
#username ⇒ Object
The username of the user.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/directory_sync/directory_user_with_groups.rb', line 41 attr_accessor \ :object, :id, :directory_id, :organization_id, :idp_id, :email, :first_name, :last_name, :name, :state, :custom_attributes, :role, :roles, :created_at, :updated_at |