Class: WorkOS::RoleCreatedData

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

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  slug: :slug,
  resource_type_slug: :resource_type_slug,
  permissions: :permissions,
  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) ⇒ RoleCreatedData

Returns a new instance of RoleCreatedData.



24
25
26
27
28
29
30
31
32
# File 'lib/workos/authorization/role_created_data.rb', line 24

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @slug = hash[:slug]
  @resource_type_slug = hash[:resource_type_slug]
  @permissions = hash[:permissions] || []
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def created_at
  @created_at
end

#objectObject

Returns the value of attribute object.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def object
  @object
end

#permissionsObject

Returns the value of attribute permissions.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def permissions
  @permissions
end

#resource_type_slugObject

Returns the value of attribute resource_type_slug.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def resource_type_slug
  @resource_type_slug
end

#slugObject

Returns the value of attribute slug.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def slug
  @slug
end

#updated_atObject

Returns the value of attribute updated_at.



16
17
18
# File 'lib/workos/authorization/role_created_data.rb', line 16

def updated_at
  @updated_at
end