Class: OryClient::IssuedAPIKey

Inherits:
ApiModelBase show all
Defined in:
lib/ory-client/models/issued_api_key.rb

Overview

IssuedAPIKey represents an API key issued (generated) by Talos. Root keys are opaque v1 format tokens stored in the database. Derived tokens (JWT/Macaroon) are created via DeriveToken and are stateless (not stored).

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ IssuedAPIKey

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/ory-client/models/issued_api_key.rb', line 133

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `OryClient::IssuedAPIKey` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `OryClient::IssuedAPIKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'actor_id')
    self.actor_id = attributes[:'actor_id']
  end

  if attributes.key?(:'create_time')
    self.create_time = attributes[:'create_time']
  end

  if attributes.key?(:'expire_time')
    self.expire_time = attributes[:'expire_time']
  end

  if attributes.key?(:'ip_restriction')
    self.ip_restriction = attributes[:'ip_restriction']
  end

  if attributes.key?(:'key_id')
    self.key_id = attributes[:'key_id']
  end

  if attributes.key?(:'last_used_time')
    self.last_used_time = attributes[:'last_used_time']
  end

  if attributes.key?(:'metadata')
    self. = attributes[:'metadata']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'rate_limit_policy')
    self.rate_limit_policy = attributes[:'rate_limit_policy']
  end

  if attributes.key?(:'revocation_description')
    self.revocation_description = attributes[:'revocation_description']
  end

  if attributes.key?(:'revocation_reason')
    self.revocation_reason = attributes[:'revocation_reason']
  else
    self.revocation_reason = 'REVOCATION_REASON_UNSPECIFIED'
  end

  if attributes.key?(:'scopes')
    if (value = attributes[:'scopes']).is_a?(Array)
      self.scopes = value
    end
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  else
    self.status = 'KEY_STATUS_UNSPECIFIED'
  end

  if attributes.key?(:'update_time')
    self.update_time = attributes[:'update_time']
  end

  if attributes.key?(:'visibility')
    self.visibility = attributes[:'visibility']
  else
    self.visibility = 'KEY_VISIBILITY_UNSPECIFIED'
  end
end

Instance Attribute Details

#actor_idObject

Returns the value of attribute actor_id.



19
20
21
# File 'lib/ory-client/models/issued_api_key.rb', line 19

def actor_id
  @actor_id
end

#create_timeObject

Returns the value of attribute create_time.



21
22
23
# File 'lib/ory-client/models/issued_api_key.rb', line 21

def create_time
  @create_time
end

#expire_timeObject

Returns the value of attribute expire_time.



23
24
25
# File 'lib/ory-client/models/issued_api_key.rb', line 23

def expire_time
  @expire_time
end

#ip_restrictionObject

Returns the value of attribute ip_restriction.



25
26
27
# File 'lib/ory-client/models/issued_api_key.rb', line 25

def ip_restriction
  @ip_restriction
end

#key_idObject

Returns the value of attribute key_id.



27
28
29
# File 'lib/ory-client/models/issued_api_key.rb', line 27

def key_id
  @key_id
end

#last_used_timeObject

Returns the value of attribute last_used_time.



29
30
31
# File 'lib/ory-client/models/issued_api_key.rb', line 29

def last_used_time
  @last_used_time
end

#metadataObject

metadata is a free-form JSON object for caller-defined attributes (e.g., source, environment, tags). Values may be strings, numbers, booleans, arrays, objects, or null. Total serialized size is capped at 4KB. AIP-148 metadata field.



32
33
34
# File 'lib/ory-client/models/issued_api_key.rb', line 32

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



34
35
36
# File 'lib/ory-client/models/issued_api_key.rb', line 34

def name
  @name
end

#rate_limit_policyObject

Returns the value of attribute rate_limit_policy.



36
37
38
# File 'lib/ory-client/models/issued_api_key.rb', line 36

def rate_limit_policy
  @rate_limit_policy
end

#revocation_descriptionObject

revocation_description provides free-form context for a revocation. Only set when revocation_reason is PRIVILEGE_WITHDRAWN. JSON API change: field was formerly revocation_reason_text. Field number 13 is unchanged so the change is wire-compatible for binary proto encoding.



39
40
41
# File 'lib/ory-client/models/issued_api_key.rb', line 39

def revocation_description
  @revocation_description
end

#revocation_reasonObject

Returns the value of attribute revocation_reason.



41
42
43
# File 'lib/ory-client/models/issued_api_key.rb', line 41

def revocation_reason
  @revocation_reason
end

#scopesObject

Returns the value of attribute scopes.



43
44
45
# File 'lib/ory-client/models/issued_api_key.rb', line 43

def scopes
  @scopes
end

#statusObject

Returns the value of attribute status.



45
46
47
# File 'lib/ory-client/models/issued_api_key.rb', line 45

def status
  @status
end

#update_timeObject

Returns the value of attribute update_time.



47
48
49
# File 'lib/ory-client/models/issued_api_key.rb', line 47

def update_time
  @update_time
end

#visibilityObject

Returns the value of attribute visibility.



49
50
51
# File 'lib/ory-client/models/issued_api_key.rb', line 49

def visibility
  @visibility
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



95
96
97
# File 'lib/ory-client/models/issued_api_key.rb', line 95

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



100
101
102
# File 'lib/ory-client/models/issued_api_key.rb', line 100

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/ory-client/models/issued_api_key.rb', line 74

def self.attribute_map
  {
    :'actor_id' => :'actor_id',
    :'create_time' => :'create_time',
    :'expire_time' => :'expire_time',
    :'ip_restriction' => :'ip_restriction',
    :'key_id' => :'key_id',
    :'last_used_time' => :'last_used_time',
    :'metadata' => :'metadata',
    :'name' => :'name',
    :'rate_limit_policy' => :'rate_limit_policy',
    :'revocation_description' => :'revocation_description',
    :'revocation_reason' => :'revocation_reason',
    :'scopes' => :'scopes',
    :'status' => :'status',
    :'update_time' => :'update_time',
    :'visibility' => :'visibility'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/ory-client/models/issued_api_key.rb', line 268

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



126
127
128
129
# File 'lib/ory-client/models/issued_api_key.rb', line 126

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/ory-client/models/issued_api_key.rb', line 105

def self.openapi_types
  {
    :'actor_id' => :'String',
    :'create_time' => :'Time',
    :'expire_time' => :'Time',
    :'ip_restriction' => :'IPRestriction',
    :'key_id' => :'String',
    :'last_used_time' => :'Time',
    :'metadata' => :'Object',
    :'name' => :'String',
    :'rate_limit_policy' => :'RateLimitPolicy',
    :'revocation_description' => :'String',
    :'revocation_reason' => :'RevocationReason',
    :'scopes' => :'Array<String>',
    :'status' => :'KeyStatus',
    :'update_time' => :'Time',
    :'visibility' => :'KeyVisibility'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/ory-client/models/issued_api_key.rb', line 233

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      actor_id == o.actor_id &&
      create_time == o.create_time &&
      expire_time == o.expire_time &&
      ip_restriction == o.ip_restriction &&
      key_id == o.key_id &&
      last_used_time == o.last_used_time &&
       == o. &&
      name == o.name &&
      rate_limit_policy == o.rate_limit_policy &&
      revocation_description == o.revocation_description &&
      revocation_reason == o.revocation_reason &&
      scopes == o.scopes &&
      status == o.status &&
      update_time == o.update_time &&
      visibility == o.visibility
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


255
256
257
# File 'lib/ory-client/models/issued_api_key.rb', line 255

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



261
262
263
# File 'lib/ory-client/models/issued_api_key.rb', line 261

def hash
  [actor_id, create_time, expire_time, ip_restriction, key_id, last_used_time, , name, rate_limit_policy, revocation_description, revocation_reason, scopes, status, update_time, visibility].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



218
219
220
221
222
# File 'lib/ory-client/models/issued_api_key.rb', line 218

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/ory-client/models/issued_api_key.rb', line 290

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



226
227
228
229
# File 'lib/ory-client/models/issued_api_key.rb', line 226

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end