Class: Akeyless::CertificateInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/akeyless/models/certificate_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CertificateInfo

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/akeyless/models/certificate_info.rb', line 136

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#dns_namesObject

Returns the value of attribute dns_names.



23
24
25
# File 'lib/akeyless/models/certificate_info.rb', line 23

def dns_names
  @dns_names
end

#email_addressesObject

Returns the value of attribute email_addresses.



25
26
27
# File 'lib/akeyless/models/certificate_info.rb', line 25

def email_addresses
  @email_addresses
end

#ext_key_usageObject

Returns the value of attribute ext_key_usage.



18
19
20
# File 'lib/akeyless/models/certificate_info.rb', line 18

def ext_key_usage
  @ext_key_usage
end

#extensionsObject

Returns the value of attribute extensions.



27
28
29
# File 'lib/akeyless/models/certificate_info.rb', line 27

def extensions
  @extensions
end

#ip_addressesObject

Returns the value of attribute ip_addresses.



29
30
31
# File 'lib/akeyless/models/certificate_info.rb', line 29

def ip_addresses
  @ip_addresses
end

#is_caObject

Returns the value of attribute is_ca.



31
32
33
# File 'lib/akeyless/models/certificate_info.rb', line 31

def is_ca
  @is_ca
end

#issuerObject

Returns the value of attribute issuer.



33
34
35
# File 'lib/akeyless/models/certificate_info.rb', line 33

def issuer
  @issuer
end

#issuing_certificate_urlObject

Returns the value of attribute issuing_certificate_url.



35
36
37
# File 'lib/akeyless/models/certificate_info.rb', line 35

def issuing_certificate_url
  @issuing_certificate_url
end

#key_sizeObject

Returns the value of attribute key_size.



37
38
39
# File 'lib/akeyless/models/certificate_info.rb', line 37

def key_size
  @key_size
end

#key_usageObject

KeyUsage represents the set of actions that are valid for a given key. It’s a bitmap of the KeyUsage* constants.



21
22
23
# File 'lib/akeyless/models/certificate_info.rb', line 21

def key_usage
  @key_usage
end

#not_afterObject

Returns the value of attribute not_after.



39
40
41
# File 'lib/akeyless/models/certificate_info.rb', line 39

def not_after
  @not_after
end

#not_beforeObject

Returns the value of attribute not_before.



41
42
43
# File 'lib/akeyless/models/certificate_info.rb', line 41

def not_before
  @not_before
end

#ocsp_serverObject

Returns the value of attribute ocsp_server.



43
44
45
# File 'lib/akeyless/models/certificate_info.rb', line 43

def ocsp_server
  @ocsp_server
end

#public_key_algorithm_nameObject

Returns the value of attribute public_key_algorithm_name.



45
46
47
# File 'lib/akeyless/models/certificate_info.rb', line 45

def public_key_algorithm_name
  @public_key_algorithm_name
end

#serial_numberObject

Returns the value of attribute serial_number.



47
48
49
# File 'lib/akeyless/models/certificate_info.rb', line 47

def serial_number
  @serial_number
end

#sha_1_fingerprintObject

Returns the value of attribute sha_1_fingerprint.



49
50
51
# File 'lib/akeyless/models/certificate_info.rb', line 49

def sha_1_fingerprint
  @sha_1_fingerprint
end

#sha_256_fingerprintObject

Returns the value of attribute sha_256_fingerprint.



51
52
53
# File 'lib/akeyless/models/certificate_info.rb', line 51

def sha_256_fingerprint
  @sha_256_fingerprint
end

#signatureObject

Returns the value of attribute signature.



53
54
55
# File 'lib/akeyless/models/certificate_info.rb', line 53

def signature
  @signature
end

#signature_algorithm_nameObject

Returns the value of attribute signature_algorithm_name.



55
56
57
# File 'lib/akeyless/models/certificate_info.rb', line 55

def signature_algorithm_name
  @signature_algorithm_name
end

#subjectObject

Returns the value of attribute subject.



57
58
59
# File 'lib/akeyless/models/certificate_info.rb', line 57

def subject
  @subject
end

#subject_public_keyObject

Returns the value of attribute subject_public_key.



59
60
61
# File 'lib/akeyless/models/certificate_info.rb', line 59

def subject_public_key
  @subject_public_key
end

#urisObject

Returns the value of attribute uris.



61
62
63
# File 'lib/akeyless/models/certificate_info.rb', line 61

def uris
  @uris
end

#versionObject

Returns the value of attribute version.



63
64
65
# File 'lib/akeyless/models/certificate_info.rb', line 63

def version
  @version
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/akeyless/models/certificate_info.rb', line 342

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Akeyless.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



95
96
97
# File 'lib/akeyless/models/certificate_info.rb', line 95

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/akeyless/models/certificate_info.rb', line 66

def self.attribute_map
  {
    :'ext_key_usage' => :'ExtKeyUsage',
    :'key_usage' => :'KeyUsage',
    :'dns_names' => :'dns_names',
    :'email_addresses' => :'email_addresses',
    :'extensions' => :'extensions',
    :'ip_addresses' => :'ip_addresses',
    :'is_ca' => :'is_ca',
    :'issuer' => :'issuer',
    :'issuing_certificate_url' => :'issuing_certificate_url',
    :'key_size' => :'key_size',
    :'not_after' => :'not_after',
    :'not_before' => :'not_before',
    :'ocsp_server' => :'ocsp_server',
    :'public_key_algorithm_name' => :'public_key_algorithm_name',
    :'serial_number' => :'serial_number',
    :'sha_1_fingerprint' => :'sha_1_fingerprint',
    :'sha_256_fingerprint' => :'sha_256_fingerprint',
    :'signature' => :'signature',
    :'signature_algorithm_name' => :'signature_algorithm_name',
    :'subject' => :'subject',
    :'subject_public_key' => :'subject_public_key',
    :'uris' => :'uris',
    :'version' => :'version'
  }
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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/akeyless/models/certificate_info.rb', line 318

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



129
130
131
132
# File 'lib/akeyless/models/certificate_info.rb', line 129

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

.openapi_typesObject

Attribute type mapping.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/akeyless/models/certificate_info.rb', line 100

def self.openapi_types
  {
    :'ext_key_usage' => :'Array<Integer>',
    :'key_usage' => :'Integer',
    :'dns_names' => :'Array<String>',
    :'email_addresses' => :'Array<String>',
    :'extensions' => :'Array<Extension>',
    :'ip_addresses' => :'Array<String>',
    :'is_ca' => :'Boolean',
    :'issuer' => :'Name',
    :'issuing_certificate_url' => :'Array<String>',
    :'key_size' => :'Integer',
    :'not_after' => :'Time',
    :'not_before' => :'Time',
    :'ocsp_server' => :'Array<String>',
    :'public_key_algorithm_name' => :'String',
    :'serial_number' => :'String',
    :'sha_1_fingerprint' => :'String',
    :'sha_256_fingerprint' => :'String',
    :'signature' => :'String',
    :'signature_algorithm_name' => :'String',
    :'subject' => :'Name',
    :'subject_public_key' => :'String',
    :'uris' => :'Array<String>',
    :'version' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/akeyless/models/certificate_info.rb', line 275

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ext_key_usage == o.ext_key_usage &&
      key_usage == o.key_usage &&
      dns_names == o.dns_names &&
      email_addresses == o.email_addresses &&
      extensions == o.extensions &&
      ip_addresses == o.ip_addresses &&
      is_ca == o.is_ca &&
      issuer == o.issuer &&
      issuing_certificate_url == o.issuing_certificate_url &&
      key_size == o.key_size &&
      not_after == o.not_after &&
      not_before == o.not_before &&
      ocsp_server == o.ocsp_server &&
      public_key_algorithm_name == o.public_key_algorithm_name &&
      serial_number == o.serial_number &&
      sha_1_fingerprint == o.sha_1_fingerprint &&
      sha_256_fingerprint == o.sha_256_fingerprint &&
      signature == o.signature &&
      signature_algorithm_name == o.signature_algorithm_name &&
      subject == o.subject &&
      subject_public_key == o.subject_public_key &&
      uris == o.uris &&
      version == o.version
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/akeyless/models/certificate_info.rb', line 413

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


305
306
307
# File 'lib/akeyless/models/certificate_info.rb', line 305

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



311
312
313
# File 'lib/akeyless/models/certificate_info.rb', line 311

def hash
  [ext_key_usage, key_usage, dns_names, email_addresses, extensions, ip_addresses, is_ca, issuer, issuing_certificate_url, key_size, not_after, not_before, ocsp_server, public_key_algorithm_name, serial_number, sha_1_fingerprint, sha_256_fingerprint, signature, signature_algorithm_name, subject, subject_public_key, uris, version].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



260
261
262
263
264
# File 'lib/akeyless/models/certificate_info.rb', line 260

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

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



389
390
391
# File 'lib/akeyless/models/certificate_info.rb', line 389

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/akeyless/models/certificate_info.rb', line 395

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



383
384
385
# File 'lib/akeyless/models/certificate_info.rb', line 383

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



268
269
270
271
# File 'lib/akeyless/models/certificate_info.rb', line 268

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