Class: WorkOS::Organization
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::Organization
- Defined in:
- lib/workos/organizations/organization.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, name: :name, domains: :domains, metadata: :metadata, external_id: :external_id, stripe_customer_id: :stripe_customer_id, created_at: :created_at, updated_at: :updated_at, allow_profiles_outside_organization: :allow_profiles_outside_organization }.freeze
Instance Attribute Summary collapse
-
#allow_profiles_outside_organization ⇒ Object
deprecated
Deprecated.
Whether the Organization allows profiles outside of its managed domains.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#stripe_customer_id ⇒ Object
Returns the value of attribute stripe_customer_id.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ Organization
constructor
A new instance of Organization.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ Organization
Returns a new instance of Organization.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/workos/organizations/organization.rb', line 41 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] @name = hash[:name] @domains = (hash[:domains] || []).map { |item| item ? WorkOS::OrganizationDomain.new(item) : nil } @metadata = hash[:metadata] || {} @external_id = hash[:external_id] @stripe_customer_id = hash[:stripe_customer_id] @created_at = hash[:created_at] @updated_at = hash[:updated_at] @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] end |
Instance Attribute Details
#allow_profiles_outside_organization ⇒ Object
Whether the Organization allows profiles outside of its managed domains.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/workos/organizations/organization.rb', line 23 attr_accessor \ :object, :id, :name, :domains, :metadata, :external_id, :stripe_customer_id, :created_at, :updated_at |
#created_at ⇒ Object
Returns the value of attribute created_at.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def created_at @created_at end |
#domains ⇒ Object
Returns the value of attribute domains.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def domains @domains end |
#external_id ⇒ Object
Returns the value of attribute external_id.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def external_id @external_id end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def object @object end |
#stripe_customer_id ⇒ Object
Returns the value of attribute stripe_customer_id.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def stripe_customer_id @stripe_customer_id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
23 24 25 |
# File 'lib/workos/organizations/organization.rb', line 23 def updated_at @updated_at end |