Class: SDM::Token
- Inherits:
-
Object
- Object
- SDM::Token
- Defined in:
- lib/models/porcelain.rb
Overview
A Token is an account providing tokenized access for automation or integration use. Tokens include admin tokens, API keys, and SCIM tokens.
Instance Attribute Summary collapse
-
#account_type ⇒ Object
Corresponds to the type of token, e.g.
-
#deadline ⇒ Object
The timestamp when the Token will expire.
-
#duration ⇒ Object
Duration from token creation to expiration.
-
#id ⇒ Object
Unique identifier of the Token.
-
#name ⇒ Object
Unique human-readable name of the Token.
-
#permissions ⇒ Object
Permissions assigned to the token, e.g.
-
#rekeyed ⇒ Object
The timestamp when the Token was last rekeyed.
-
#suspended ⇒ Object
Reserved for future use.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(account_type: nil, deadline: nil, duration: nil, id: nil, name: nil, permissions: nil, rekeyed: nil, suspended: nil, tags: nil) ⇒ Token
constructor
A new instance of Token.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(account_type: nil, deadline: nil, duration: nil, id: nil, name: nil, permissions: nil, rekeyed: nil, suspended: nil, tags: nil) ⇒ Token
Returns a new instance of Token.
16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 |
# File 'lib/models/porcelain.rb', line 16002 def initialize( account_type: nil, deadline: nil, duration: nil, id: nil, name: nil, permissions: nil, rekeyed: nil, suspended: nil, tags: nil ) @account_type = account_type == nil ? "" : account_type @deadline = deadline == nil ? nil : deadline @duration = duration == nil ? nil : duration @id = id == nil ? "" : id @name = name == nil ? "" : name = == nil ? [] : @rekeyed = rekeyed == nil ? nil : rekeyed @suspended = suspended == nil ? false : suspended = == nil ? SDM::() : end |
Instance Attribute Details
#account_type ⇒ Object
Corresponds to the type of token, e.g. api or admin-token.
15984 15985 15986 |
# File 'lib/models/porcelain.rb', line 15984 def account_type @account_type end |
#deadline ⇒ Object
The timestamp when the Token will expire.
15986 15987 15988 |
# File 'lib/models/porcelain.rb', line 15986 def deadline @deadline end |
#duration ⇒ Object
Duration from token creation to expiration.
15988 15989 15990 |
# File 'lib/models/porcelain.rb', line 15988 def duration @duration end |
#id ⇒ Object
Unique identifier of the Token.
15990 15991 15992 |
# File 'lib/models/porcelain.rb', line 15990 def id @id end |
#name ⇒ Object
Unique human-readable name of the Token.
15992 15993 15994 |
# File 'lib/models/porcelain.rb', line 15992 def name @name end |
#permissions ⇒ Object
Permissions assigned to the token, e.g. role:create.
15994 15995 15996 |
# File 'lib/models/porcelain.rb', line 15994 def end |
#rekeyed ⇒ Object
The timestamp when the Token was last rekeyed.
15996 15997 15998 |
# File 'lib/models/porcelain.rb', line 15996 def rekeyed @rekeyed end |
#suspended ⇒ Object
Reserved for future use. Always false for tokens.
15998 15999 16000 |
# File 'lib/models/porcelain.rb', line 15998 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
16000 16001 16002 |
# File 'lib/models/porcelain.rb', line 16000 def end |
Instance Method Details
#to_json(options = {}) ⇒ Object
16024 16025 16026 16027 16028 16029 16030 |
# File 'lib/models/porcelain.rb', line 16024 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |