Class: OCI::GoldenGate::Models::Certificate

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/golden_gate/models/certificate.rb

Overview

Certificate data.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Certificate

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :deployment_id (String)

    The value to assign to the #deployment_id property

  • :certificate_content (String)

    The value to assign to the #certificate_content property

  • :issuer (String)

    The value to assign to the #issuer property

  • :is_self_signed (BOOLEAN)

    The value to assign to the #is_self_signed property

  • :md5_hash (String)

    The value to assign to the #md5_hash property

  • :public_key (String)

    The value to assign to the #public_key property

  • :public_key_algorithm (String)

    The value to assign to the #public_key_algorithm property

  • :public_key_size (Integer)

    The value to assign to the #public_key_size property

  • :serial (String)

    The value to assign to the #serial property

  • :subject (String)

    The value to assign to the #subject property

  • :time_valid_from (DateTime)

    The value to assign to the #time_valid_from property

  • :time_valid_to (DateTime)

    The value to assign to the #time_valid_to property

  • :version (String)

    The value to assign to the #version property

  • :sha1_hash (String)

    The value to assign to the #sha1_hash property

  • :authority_key_id (String)

    The value to assign to the #authority_key_id property

  • :is_ca (BOOLEAN)

    The value to assign to the #is_ca property

  • :subject_key_id (String)

    The value to assign to the #subject_key_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :time_created (DateTime)

    The value to assign to the #time_created property



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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
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
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/oci/golden_gate/models/certificate.rb', line 207

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.key = attributes[:'key'] if attributes[:'key']

  self.deployment_id = attributes[:'deploymentId'] if attributes[:'deploymentId']

  raise 'You cannot provide both :deploymentId and :deployment_id' if attributes.key?(:'deploymentId') && attributes.key?(:'deployment_id')

  self.deployment_id = attributes[:'deployment_id'] if attributes[:'deployment_id']

  self.certificate_content = attributes[:'certificateContent'] if attributes[:'certificateContent']

  raise 'You cannot provide both :certificateContent and :certificate_content' if attributes.key?(:'certificateContent') && attributes.key?(:'certificate_content')

  self.certificate_content = attributes[:'certificate_content'] if attributes[:'certificate_content']

  self.issuer = attributes[:'issuer'] if attributes[:'issuer']

  self.is_self_signed = attributes[:'isSelfSigned'] unless attributes[:'isSelfSigned'].nil?

  raise 'You cannot provide both :isSelfSigned and :is_self_signed' if attributes.key?(:'isSelfSigned') && attributes.key?(:'is_self_signed')

  self.is_self_signed = attributes[:'is_self_signed'] unless attributes[:'is_self_signed'].nil?

  self.md5_hash = attributes[:'md5Hash'] if attributes[:'md5Hash']

  raise 'You cannot provide both :md5Hash and :md5_hash' if attributes.key?(:'md5Hash') && attributes.key?(:'md5_hash')

  self.md5_hash = attributes[:'md5_hash'] if attributes[:'md5_hash']

  self.public_key = attributes[:'publicKey'] if attributes[:'publicKey']

  raise 'You cannot provide both :publicKey and :public_key' if attributes.key?(:'publicKey') && attributes.key?(:'public_key')

  self.public_key = attributes[:'public_key'] if attributes[:'public_key']

  self.public_key_algorithm = attributes[:'publicKeyAlgorithm'] if attributes[:'publicKeyAlgorithm']

  raise 'You cannot provide both :publicKeyAlgorithm and :public_key_algorithm' if attributes.key?(:'publicKeyAlgorithm') && attributes.key?(:'public_key_algorithm')

  self.public_key_algorithm = attributes[:'public_key_algorithm'] if attributes[:'public_key_algorithm']

  self.public_key_size = attributes[:'publicKeySize'] if attributes[:'publicKeySize']

  raise 'You cannot provide both :publicKeySize and :public_key_size' if attributes.key?(:'publicKeySize') && attributes.key?(:'public_key_size')

  self.public_key_size = attributes[:'public_key_size'] if attributes[:'public_key_size']

  self.serial = attributes[:'serial'] if attributes[:'serial']

  self.subject = attributes[:'subject'] if attributes[:'subject']

  self.time_valid_from = attributes[:'timeValidFrom'] if attributes[:'timeValidFrom']

  raise 'You cannot provide both :timeValidFrom and :time_valid_from' if attributes.key?(:'timeValidFrom') && attributes.key?(:'time_valid_from')

  self.time_valid_from = attributes[:'time_valid_from'] if attributes[:'time_valid_from']

  self.time_valid_to = attributes[:'timeValidTo'] if attributes[:'timeValidTo']

  raise 'You cannot provide both :timeValidTo and :time_valid_to' if attributes.key?(:'timeValidTo') && attributes.key?(:'time_valid_to')

  self.time_valid_to = attributes[:'time_valid_to'] if attributes[:'time_valid_to']

  self.version = attributes[:'version'] if attributes[:'version']

  self.sha1_hash = attributes[:'sha1Hash'] if attributes[:'sha1Hash']

  raise 'You cannot provide both :sha1Hash and :sha1_hash' if attributes.key?(:'sha1Hash') && attributes.key?(:'sha1_hash')

  self.sha1_hash = attributes[:'sha1_hash'] if attributes[:'sha1_hash']

  self.authority_key_id = attributes[:'authorityKeyId'] if attributes[:'authorityKeyId']

  raise 'You cannot provide both :authorityKeyId and :authority_key_id' if attributes.key?(:'authorityKeyId') && attributes.key?(:'authority_key_id')

  self.authority_key_id = attributes[:'authority_key_id'] if attributes[:'authority_key_id']

  self.is_ca = attributes[:'isCa'] unless attributes[:'isCa'].nil?

  raise 'You cannot provide both :isCa and :is_ca' if attributes.key?(:'isCa') && attributes.key?(:'is_ca')

  self.is_ca = attributes[:'is_ca'] unless attributes[:'is_ca'].nil?

  self.subject_key_id = attributes[:'subjectKeyId'] if attributes[:'subjectKeyId']

  raise 'You cannot provide both :subjectKeyId and :subject_key_id' if attributes.key?(:'subjectKeyId') && attributes.key?(:'subject_key_id')

  self.subject_key_id = attributes[:'subject_key_id'] if attributes[:'subject_key_id']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']
end

Instance Attribute Details

#authority_key_idString

[Required] The Certificate authority key id.

Returns:

  • (String)


102
103
104
# File 'lib/oci/golden_gate/models/certificate.rb', line 102

def authority_key_id
  @authority_key_id
end

#certificate_contentString

[Required] A PEM-encoded SSL certificate.

Returns:

  • (String)


35
36
37
# File 'lib/oci/golden_gate/models/certificate.rb', line 35

def certificate_content
  @certificate_content
end

#deployment_idString

[Required] The OCID of the deployment being referenced.

Returns:

  • (String)


30
31
32
# File 'lib/oci/golden_gate/models/certificate.rb', line 30

def deployment_id
  @deployment_id
end

#is_caBOOLEAN

[Required] Indicates if the certificate is ca.

Returns:

  • (BOOLEAN)


107
108
109
# File 'lib/oci/golden_gate/models/certificate.rb', line 107

def is_ca
  @is_ca
end

#is_self_signedBOOLEAN

[Required] Indicates if the certificate is self signed.

Returns:

  • (BOOLEAN)


45
46
47
# File 'lib/oci/golden_gate/models/certificate.rb', line 45

def is_self_signed
  @is_self_signed
end

#issuerString

[Required] The Certificate issuer.

Returns:

  • (String)


40
41
42
# File 'lib/oci/golden_gate/models/certificate.rb', line 40

def issuer
  @issuer
end

#keyString

[Required] The identifier key (unique name in the scope of the deployment) of the certificate being referenced. It must be 1 to 32 characters long, must contain only alphanumeric characters and must start with a letter.

Returns:

  • (String)


25
26
27
# File 'lib/oci/golden_gate/models/certificate.rb', line 25

def key
  @key
end

#lifecycle_stateString

[Required] Possible certificate lifecycle states.

Returns:

  • (String)


117
118
119
# File 'lib/oci/golden_gate/models/certificate.rb', line 117

def lifecycle_state
  @lifecycle_state
end

#md5_hashString

[Required] The Certificate md5Hash.

Returns:

  • (String)


50
51
52
# File 'lib/oci/golden_gate/models/certificate.rb', line 50

def md5_hash
  @md5_hash
end

#public_keyString

[Required] The Certificate public key.

Returns:

  • (String)


55
56
57
# File 'lib/oci/golden_gate/models/certificate.rb', line 55

def public_key
  @public_key
end

#public_key_algorithmString

[Required] The Certificate public key algorithm.

Returns:

  • (String)


60
61
62
# File 'lib/oci/golden_gate/models/certificate.rb', line 60

def public_key_algorithm
  @public_key_algorithm
end

#public_key_sizeInteger

[Required] The Certificate public key size.

Returns:

  • (Integer)


65
66
67
# File 'lib/oci/golden_gate/models/certificate.rb', line 65

def public_key_size
  @public_key_size
end

#serialString

[Required] The Certificate serial.

Returns:

  • (String)


70
71
72
# File 'lib/oci/golden_gate/models/certificate.rb', line 70

def serial
  @serial
end

#sha1_hashString

[Required] The Certificate sha1 hash.

Returns:

  • (String)


97
98
99
# File 'lib/oci/golden_gate/models/certificate.rb', line 97

def sha1_hash
  @sha1_hash
end

#subjectString

[Required] The Certificate subject.

Returns:

  • (String)


75
76
77
# File 'lib/oci/golden_gate/models/certificate.rb', line 75

def subject
  @subject
end

#subject_key_idString

[Required] The Certificate subject key id.

Returns:

  • (String)


112
113
114
# File 'lib/oci/golden_gate/models/certificate.rb', line 112

def subject_key_id
  @subject_key_id
end

#time_createdDateTime

[Required] The time the resource was created. The format is defined by RFC3339, such as 2016-08-25T21:10:29.600Z.

Returns:

  • (DateTime)


123
124
125
# File 'lib/oci/golden_gate/models/certificate.rb', line 123

def time_created
  @time_created
end

#time_valid_fromDateTime

[Required] The time the certificate is valid from. The format is defined by RFC3339, such as 2016-08-25T21:10:29.600Z.

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/golden_gate/models/certificate.rb', line 81

def time_valid_from
  @time_valid_from
end

#time_valid_toDateTime

[Required] The time the certificate is valid to. The format is defined by RFC3339, such as 2016-08-25T21:10:29.600Z.

Returns:

  • (DateTime)


87
88
89
# File 'lib/oci/golden_gate/models/certificate.rb', line 87

def time_valid_to
  @time_valid_to
end

#versionString

[Required] The Certificate version.

Returns:

  • (String)


92
93
94
# File 'lib/oci/golden_gate/models/certificate.rb', line 92

def version
  @version
end

Class Method Details

.attribute_mapObject

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



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/oci/golden_gate/models/certificate.rb', line 126

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'deployment_id': :'deploymentId',
    'certificate_content': :'certificateContent',
    'issuer': :'issuer',
    'is_self_signed': :'isSelfSigned',
    'md5_hash': :'md5Hash',
    'public_key': :'publicKey',
    'public_key_algorithm': :'publicKeyAlgorithm',
    'public_key_size': :'publicKeySize',
    'serial': :'serial',
    'subject': :'subject',
    'time_valid_from': :'timeValidFrom',
    'time_valid_to': :'timeValidTo',
    'version': :'version',
    'sha1_hash': :'sha1Hash',
    'authority_key_id': :'authorityKeyId',
    'is_ca': :'isCa',
    'subject_key_id': :'subjectKeyId',
    'lifecycle_state': :'lifecycleState',
    'time_created': :'timeCreated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/golden_gate/models/certificate.rb', line 154

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'deployment_id': :'String',
    'certificate_content': :'String',
    'issuer': :'String',
    'is_self_signed': :'BOOLEAN',
    'md5_hash': :'String',
    'public_key': :'String',
    'public_key_algorithm': :'String',
    'public_key_size': :'Integer',
    'serial': :'String',
    'subject': :'String',
    'time_valid_from': :'DateTime',
    'time_valid_to': :'DateTime',
    'version': :'String',
    'sha1_hash': :'String',
    'authority_key_id': :'String',
    'is_ca': :'BOOLEAN',
    'subject_key_id': :'String',
    'lifecycle_state': :'String',
    'time_created': :'DateTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/oci/golden_gate/models/certificate.rb', line 334

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    key == other.key &&
    deployment_id == other.deployment_id &&
    certificate_content == other.certificate_content &&
    issuer == other.issuer &&
    is_self_signed == other.is_self_signed &&
    md5_hash == other.md5_hash &&
    public_key == other.public_key &&
    public_key_algorithm == other.public_key_algorithm &&
    public_key_size == other.public_key_size &&
    serial == other.serial &&
    subject == other.subject &&
    time_valid_from == other.time_valid_from &&
    time_valid_to == other.time_valid_to &&
    version == other.version &&
    sha1_hash == other.sha1_hash &&
    authority_key_id == other.authority_key_id &&
    is_ca == other.is_ca &&
    subject_key_id == other.subject_key_id &&
    lifecycle_state == other.lifecycle_state &&
    time_created == other.time_created
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



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/oci/golden_gate/models/certificate.rb', line 383

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


363
364
365
# File 'lib/oci/golden_gate/models/certificate.rb', line 363

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



372
373
374
# File 'lib/oci/golden_gate/models/certificate.rb', line 372

def hash
  [key, deployment_id, certificate_content, issuer, is_self_signed, md5_hash, public_key, public_key_algorithm, public_key_size, serial, subject, time_valid_from, time_valid_to, version, sha1_hash, authority_key_id, is_ca, subject_key_id, lifecycle_state, time_created].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



416
417
418
419
420
421
422
423
424
425
# File 'lib/oci/golden_gate/models/certificate.rb', line 416

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



410
411
412
# File 'lib/oci/golden_gate/models/certificate.rb', line 410

def to_s
  to_hash.to_s
end