Class: WorkOS::OrganizationInput

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/organizations/organization_input.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OrganizationInput

Returns a new instance of OrganizationInput.



33
34
35
36
37
38
39
40
41
# File 'lib/workos/organizations/organization_input.rb', line 33

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 }
  @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.



19
20
21
# File 'lib/workos/organizations/organization_input.rb', line 19

def allow_profiles_outside_organization
  @allow_profiles_outside_organization
end

#domain_dataObject

Returns the value of attribute domain_data.



19
20
21
# File 'lib/workos/organizations/organization_input.rb', line 19

def domain_data
  @domain_data
end

#domainsObject

Deprecated.

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



19
20
21
22
23
24
# File 'lib/workos/organizations/organization_input.rb', line 19

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

#external_idObject

Returns the value of attribute external_id.



19
20
21
# File 'lib/workos/organizations/organization_input.rb', line 19

def external_id
  @external_id
end

#metadataObject

Returns the value of attribute metadata.



19
20
21
# File 'lib/workos/organizations/organization_input.rb', line 19

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



19
20
21
# File 'lib/workos/organizations/organization_input.rb', line 19

def name
  @name
end