Class: WorkOS::AuthorizationResource

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/authorization/authorization_resource.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  name: :name,
  description: :description,
  organization_id: :organization_id,
  parent_resource_id: :parent_resource_id,
  id: :id,
  external_id: :external_id,
  resource_type_slug: :resource_type_slug,
  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) ⇒ AuthorizationResource

Returns a new instance of AuthorizationResource.



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

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @name = hash[:name]
  @description = hash[:description]
  @organization_id = hash[:organization_id]
  @parent_resource_id = hash[:parent_resource_id]
  @id = hash[:id]
  @external_id = hash[:external_id]
  @resource_type_slug = hash[:resource_type_slug]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def description
  @description
end

#external_idObject

Returns the value of attribute external_id.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def external_id
  @external_id
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def id
  @id
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def name
  @name
end

#objectObject

Returns the value of attribute object.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def object
  @object
end

#organization_idObject

Returns the value of attribute organization_id.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def organization_id
  @organization_id
end

#parent_resource_idObject

Returns the value of attribute parent_resource_id.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def parent_resource_id
  @parent_resource_id
end

#resource_type_slugObject

Returns the value of attribute resource_type_slug.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def resource_type_slug
  @resource_type_slug
end

#updated_atObject

Returns the value of attribute updated_at.



20
21
22
# File 'lib/workos/authorization/authorization_resource.rb', line 20

def updated_at
  @updated_at
end