Class: WorkOS::CheckAuthorization

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

Constant Summary collapse

HASH_ATTRS =
{
  permission_slug: :permission_slug,
  resource_id: :resource_id,
  resource_external_id: :resource_external_id,
  resource_type_slug: :resource_type_slug
}.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) ⇒ CheckAuthorization

Returns a new instance of CheckAuthorization.



20
21
22
23
24
25
26
# File 'lib/workos/authorization/check_authorization.rb', line 20

def initialize(json)
  hash = self.class.normalize(json)
  @permission_slug = hash[:permission_slug]
  @resource_id = hash[:resource_id]
  @resource_external_id = hash[:resource_external_id]
  @resource_type_slug = hash[:resource_type_slug]
end

Instance Attribute Details

#permission_slugObject

Returns the value of attribute permission_slug.



14
15
16
# File 'lib/workos/authorization/check_authorization.rb', line 14

def permission_slug
  @permission_slug
end

#resource_external_idObject

Returns the value of attribute resource_external_id.



14
15
16
# File 'lib/workos/authorization/check_authorization.rb', line 14

def resource_external_id
  @resource_external_id
end

#resource_idObject

Returns the value of attribute resource_id.



14
15
16
# File 'lib/workos/authorization/check_authorization.rb', line 14

def resource_id
  @resource_id
end

#resource_type_slugObject

Returns the value of attribute resource_type_slug.



14
15
16
# File 'lib/workos/authorization/check_authorization.rb', line 14

def resource_type_slug
  @resource_type_slug
end