Class: WorkOS::Profile
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::Profile
- Defined in:
- lib/workos/sso/profile.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, organization_id: :organization_id, connection_id: :connection_id, connection_type: :connection_type, idp_id: :idp_id, email: :email, first_name: :first_name, last_name: :last_name, role: :role, roles: :roles, groups: :groups, custom_attributes: :custom_attributes, raw_attributes: :raw_attributes }.freeze
Instance Attribute Summary collapse
-
#connection_id ⇒ Object
Returns the value of attribute connection_id.
-
#connection_type ⇒ Object
Returns the value of attribute connection_type.
-
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
-
#email ⇒ Object
Returns the value of attribute email.
-
#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.
-
#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
Returns the value of attribute raw_attributes.
-
#role ⇒ Object
Returns the value of attribute role.
-
#roles ⇒ Object
Returns the value of attribute roles.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ Profile
constructor
A new instance of Profile.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Profile
Returns a new instance of Profile.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/sso/profile.rb', line 40 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] @organization_id = hash[:organization_id] @connection_id = hash[:connection_id] @connection_type = hash[:connection_type] @idp_id = hash[:idp_id] @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } @groups = hash[:groups] || [] @custom_attributes = hash[:custom_attributes] || {} @raw_attributes = hash[:raw_attributes] || {} end |
Instance Attribute Details
#connection_id ⇒ Object
Returns the value of attribute connection_id.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def connection_id @connection_id end |
#connection_type ⇒ Object
Returns the value of attribute connection_type.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def connection_type @connection_type end |
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def custom_attributes @custom_attributes end |
#email ⇒ Object
Returns the value of attribute email.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def first_name @first_name end |
#groups ⇒ Object
Returns the value of attribute groups.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def groups @groups end |
#id ⇒ Object
Returns the value of attribute id.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def id @id end |
#idp_id ⇒ Object
Returns the value of attribute idp_id.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def idp_id @idp_id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def last_name @last_name end |
#object ⇒ Object
Returns the value of attribute object.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def object @object end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def organization_id @organization_id end |
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def raw_attributes @raw_attributes end |
#role ⇒ Object
Returns the value of attribute role.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def role @role end |
#roles ⇒ Object
Returns the value of attribute roles.
24 25 26 |
# File 'lib/workos/sso/profile.rb', line 24 def roles @roles end |