Class: WorkOS::ApiKey
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::ApiKey
- Defined in:
- lib/workos/api_keys/api_key.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, owner: :owner, name: :name, obfuscated_value: :obfuscated_value, last_used_at: :last_used_at, permissions: :permissions, created_at: :created_at, updated_at: :updated_at }.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_used_at ⇒ Object
Returns the value of attribute last_used_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#obfuscated_value ⇒ Object
Returns the value of attribute obfuscated_value.
-
#object ⇒ Object
Returns the value of attribute object.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ApiKey
constructor
A new instance of ApiKey.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ ApiKey
Returns a new instance of ApiKey.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/workos/api_keys/api_key.rb', line 30 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] @owner = hash[:owner] ? WorkOS::ApiKeyOwner.new(hash[:owner]) : nil @name = hash[:name] @obfuscated_value = hash[:obfuscated_value] @last_used_at = hash[:last_used_at] @permissions = hash[:permissions] || [] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def id @id end |
#last_used_at ⇒ Object
Returns the value of attribute last_used_at.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def last_used_at @last_used_at end |
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def name @name end |
#obfuscated_value ⇒ Object
Returns the value of attribute obfuscated_value.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def @obfuscated_value end |
#object ⇒ Object
Returns the value of attribute object.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def object @object end |
#owner ⇒ Object
Returns the value of attribute owner.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def owner @owner end |
#permissions ⇒ Object
Returns the value of attribute permissions.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def @permissions end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
19 20 21 |
# File 'lib/workos/api_keys/api_key.rb', line 19 def updated_at @updated_at end |