Class: WorkOS::Connection

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/sso/connection.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  organization_id: :organization_id,
  connection_type: :connection_type,
  name: :name,
  state: :state,
  status: :status,
  domains: :domains,
  options: :options,
  created_at: :created_at,
  updated_at: :updated_at
}.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) ⇒ Connection

Returns a new instance of Connection.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/workos/sso/connection.rb', line 43

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

Instance Attribute Details

#connection_typeObject

Returns the value of attribute connection_type.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def connection_type
  @connection_type
end

#created_atObject

Returns the value of attribute created_at.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def created_at
  @created_at
end

#domainsObject

Returns the value of attribute domains.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def domains
  @domains
end

#idObject

Returns the value of attribute id.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def id
  @id
end

#nameObject

Returns the value of attribute name.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def name
  @name
end

#objectObject

Returns the value of attribute object.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def object
  @object
end

#optionsObject

Returns the value of attribute options.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def options
  @options
end

#organization_idObject

Returns the value of attribute organization_id.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def organization_id
  @organization_id
end

#stateObject

Returns the value of attribute state.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def state
  @state
end

#statusObject

Deprecated.

Deprecated. Use ‘state` instead.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/workos/sso/connection.rb', line 24

attr_accessor \
:object,
:id,
:organization_id,
:connection_type,
:name,
:state,
:domains,
:options,
:created_at,
:updated_at

#updated_atObject

Returns the value of attribute updated_at.



24
25
26
# File 'lib/workos/sso/connection.rb', line 24

def updated_at
  @updated_at
end