Class: WorkOS::UpdateOrganization

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/organizations/update_organization.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  allow_profiles_outside_organization: :allow_profiles_outside_organization,
  domains: :domains,
  domain_data: :domain_data,
  stripe_customer_id: :stripe_customer_id,
  metadata: :metadata,
  external_id: :external_id
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ UpdateOrganization

Returns a new instance of UpdateOrganization.



35
36
37
38
39
40
41
42
43
44
# File 'lib/workos/organizations/update_organization.rb', line 35

def initialize(json)
  hash = self.class.normalize(json)
  @name = hash[:name]
  @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization]
  @domains = hash[:domains] || []
  @domain_data = (hash[:domain_data] || []).map { |item| item ? WorkOS::OrganizationDomainData.new(item) : nil }
  @stripe_customer_id = hash[:stripe_customer_id]
  @metadata = hash[:metadata] || {}
  @external_id = hash[:external_id]
end

Instance Attribute Details

#allow_profiles_outside_organizationObject

Returns the value of attribute allow_profiles_outside_organization.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def allow_profiles_outside_organization
  @allow_profiles_outside_organization
end

#domain_dataObject

Returns the value of attribute domain_data.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def domain_data
  @domain_data
end

#domainsObject

Deprecated.

The domains associated with the organization. Deprecated in favor of ‘domain_data`.



20
21
22
23
24
25
26
# File 'lib/workos/organizations/update_organization.rb', line 20

attr_accessor \
:name,
:allow_profiles_outside_organization,
:domain_data,
:stripe_customer_id,
:metadata,
:external_id

#external_idObject

Returns the value of attribute external_id.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def external_id
  @external_id
end

#metadataObject

Returns the value of attribute metadata.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def name
  @name
end

#stripe_customer_idObject

Returns the value of attribute stripe_customer_id.



20
21
22
# File 'lib/workos/organizations/update_organization.rb', line 20

def stripe_customer_id
  @stripe_customer_id
end