Class: WorkOS::DirectoryGroup

Inherits:
DeprecatedHashWrapper show all
Includes:
HashProvider
Defined in:
lib/workos/directory_group.rb

Overview

The DirectoryGroup class provides a lightweight wrapper around a WorkOS DirectoryGroup resource. This class is not meant to be instantiated in user space, and is instantiated internally but exposed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashProvider

#to_h

Methods inherited from DeprecatedHashWrapper

#[], #replace_without_warning

Constructor Details

#initialize(json) ⇒ DirectoryGroup

Returns a new instance of DirectoryGroup.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/workos/directory_group.rb', line 13

def initialize(json)
  hash = JSON.parse(json, symbolize_names: true)

  @id = hash[:id]
  @directory_id = hash[:directory_id]
  @organization_id = hash[:organization_id]
  @idp_id = hash[:idp_id]
  @name = hash[:name]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
  @raw_attributes = hash[:raw_attributes]

  replace_without_warning(to_json)
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def created_at
  @created_at
end

#directory_idObject

Returns the value of attribute directory_id.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def directory_id
  @directory_id
end

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def id
  @id
end

#idp_idObject

Returns the value of attribute idp_id.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def idp_id
  @idp_id
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def name
  @name
end

#organization_idObject

Returns the value of attribute organization_id.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def organization_id
  @organization_id
end

#raw_attributesObject

Returns the value of attribute raw_attributes.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def raw_attributes
  @raw_attributes
end

#updated_atObject

Returns the value of attribute updated_at.



10
11
12
# File 'lib/workos/directory_group.rb', line 10

def updated_at
  @updated_at
end

Instance Method Details

#to_jsonObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/workos/directory_group.rb', line 28

def to_json(*)
  {
    id: id,
    directory_id: directory_id,
    organization_id: organization_id,
    idp_id: idp_id,
    name: name,
    created_at: created_at,
    updated_at: updated_at,
    raw_attributes: raw_attributes,
  }
end