Class: WorkOS::DsyncActivatedData

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/directory_sync/dsync_activated_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  organization_id: :organization_id,
  type: :type,
  state: :state,
  name: :name,
  created_at: :created_at,
  updated_at: :updated_at,
  external_key: :external_key,
  domains: :domains
}.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) ⇒ DsyncActivatedData

Returns a new instance of DsyncActivatedData.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 32

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @id = hash[:id]
  @organization_id = hash[:organization_id]
  @type = hash[:type]
  @state = hash[:state]
  @name = hash[:name]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
  @external_key = hash[:external_key]
  @domains = (hash[:domains] || []).map { |item| item ? WorkOS::DsyncActivatedDataDomain.new(item) : nil }
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def created_at
  @created_at
end

#domainsObject

Returns the value of attribute domains.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def domains
  @domains
end

#external_keyObject

Returns the value of attribute external_key.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def external_key
  @external_key
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def id
  @id
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def name
  @name
end

#objectObject

Returns the value of attribute object.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def object
  @object
end

#organization_idObject

Returns the value of attribute organization_id.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def organization_id
  @organization_id
end

#stateObject

Returns the value of attribute state.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def state
  @state
end

#typeObject

Returns the value of attribute type.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



20
21
22
# File 'lib/workos/directory_sync/dsync_activated_data.rb', line 20

def updated_at
  @updated_at
end