Class: WorkOS::ObjectMetadata

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/vault/object_metadata.rb

Constant Summary collapse

HASH_ATTRS =
{
  context: :context,
  environment_id: :environment_id,
  id: :id,
  key_id: :key_id,
  updated_at: :updated_at,
  updated_by: :updated_by,
  version_id: :version_id
}.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) ⇒ ObjectMetadata

Returns a new instance of ObjectMetadata.



26
27
28
29
30
31
32
33
34
35
# File 'lib/workos/vault/object_metadata.rb', line 26

def initialize(json)
  hash = self.class.normalize(json)
  @context = hash[:context] || {}
  @environment_id = hash[:environment_id]
  @id = hash[:id]
  @key_id = hash[:key_id]
  @updated_at = hash[:updated_at]
  @updated_by = hash[:updated_by] ? WorkOS::Actor.new(hash[:updated_by]) : nil
  @version_id = hash[:version_id]
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def context
  @context
end

#environment_idObject

Returns the value of attribute environment_id.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def environment_id
  @environment_id
end

#idObject

Returns the value of attribute id.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def id
  @id
end

#key_idObject

Returns the value of attribute key_id.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def key_id
  @key_id
end

#updated_atObject

Returns the value of attribute updated_at.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def updated_at
  @updated_at
end

#updated_byObject

Returns the value of attribute updated_by.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def updated_by
  @updated_by
end

#version_idObject

Returns the value of attribute version_id.



17
18
19
# File 'lib/workos/vault/object_metadata.rb', line 17

def version_id
  @version_id
end