Class: OCI::CertificatesManagement::Models::CertificateAuthority

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/certificates_management/models/certificate_authority.rb

Overview

The metadata details of the certificate authority (CA). This object does not contain the CA contents.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_SCHEDULING_DELETION = 'SCHEDULING_DELETION'.freeze,
  LIFECYCLE_STATE_PENDING_DELETION = 'PENDING_DELETION'.freeze,
  LIFECYCLE_STATE_CANCELLING_DELETION = 'CANCELLING_DELETION'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CONFIG_TYPE_ENUM =
[
  CONFIG_TYPE_ROOT_CA_GENERATED_INTERNALLY = 'ROOT_CA_GENERATED_INTERNALLY'.freeze,
  CONFIG_TYPE_SUBORDINATE_CA_ISSUED_BY_INTERNAL_CA = 'SUBORDINATE_CA_ISSUED_BY_INTERNAL_CA'.freeze,
  CONFIG_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SIGNING_ALGORITHM_ENUM =
[
  SIGNING_ALGORITHM_SHA256_WITH_RSA = 'SHA256_WITH_RSA'.freeze,
  SIGNING_ALGORITHM_SHA384_WITH_RSA = 'SHA384_WITH_RSA'.freeze,
  SIGNING_ALGORITHM_SHA512_WITH_RSA = 'SHA512_WITH_RSA'.freeze,
  SIGNING_ALGORITHM_SHA256_WITH_ECDSA = 'SHA256_WITH_ECDSA'.freeze,
  SIGNING_ALGORITHM_SHA384_WITH_ECDSA = 'SHA384_WITH_ECDSA'.freeze,
  SIGNING_ALGORITHM_SHA512_WITH_ECDSA = 'SHA512_WITH_ECDSA'.freeze,
  SIGNING_ALGORITHM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CertificateAuthority

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 195

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.id = attributes[:'id'] if attributes[:'id']

  self.issuer_certificate_authority_id = attributes[:'issuerCertificateAuthorityId'] if attributes[:'issuerCertificateAuthorityId']

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

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

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

  self.description = attributes[:'description'] if attributes[:'description']
  self.description = "null" if description.nil? && !attributes.key?(:'description') # rubocop:disable Style/StringLiterals

  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']

  self.time_of_deletion = attributes[:'timeOfDeletion'] if attributes[:'timeOfDeletion']

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

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

  self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId']

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

  self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_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.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
  self.lifecycle_details = "null" if lifecycle_details.nil? && !attributes.key?(:'lifecycleDetails') # rubocop:disable Style/StringLiterals

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

  self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
  self.lifecycle_details = "null" if lifecycle_details.nil? && !attributes.key?(:'lifecycleDetails') && !attributes.key?(:'lifecycle_details') # rubocop:disable Style/StringLiterals

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.certificate_authority_rules = attributes[:'certificateAuthorityRules'] if attributes[:'certificateAuthorityRules']

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

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

  self.current_version = attributes[:'currentVersion'] if attributes[:'currentVersion']

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

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

  self.certificate_revocation_list_details = attributes[:'certificateRevocationListDetails'] if attributes[:'certificateRevocationListDetails']

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

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

  self.config_type = attributes[:'configType'] if attributes[:'configType']

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

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

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

  self.signing_algorithm = attributes[:'signingAlgorithm'] if attributes[:'signingAlgorithm']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#certificate_authority_rulesArray<OCI::CertificatesManagement::Models::CertificateAuthorityRule>

An optional list of rules that control how the CA is used and managed.



88
89
90
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 88

def certificate_authority_rules
  @certificate_authority_rules
end

#certificate_revocation_list_detailsOCI::CertificatesManagement::Models::CertificateRevocationListDetails



94
95
96
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 94

def certificate_revocation_list_details
  @certificate_revocation_list_details
end

#compartment_idString

[Required] The OCID of the compartment under which the CA is created.

Returns:

  • (String)


84
85
86
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 84

def compartment_id
  @compartment_id
end

#config_typeString

[Required] The origin of the CA.

Returns:

  • (String)


98
99
100
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 98

def config_type
  @config_type
end

#current_versionOCI::CertificatesManagement::Models::CertificateAuthorityVersionSummary



91
92
93
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 91

def current_version
  @current_version
end

#defined_tagsHash<String, Hash<String, Object>>

Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


117
118
119
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 117

def defined_tags
  @defined_tags
end

#descriptionString

A brief description of the CA.

Returns:

  • (String)


56
57
58
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 56

def description
  @description
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


111
112
113
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 111

def freeform_tags
  @freeform_tags
end

#idString

[Required] The OCID of the CA.

Returns:

  • (String)


43
44
45
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 43

def id
  @id
end

#issuer_certificate_authority_idString

The OCID of the parent CA that issued this CA. If this is the root CA, then this value is null.

Returns:

  • (String)


48
49
50
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 48

def issuer_certificate_authority_id
  @issuer_certificate_authority_id
end

#kms_key_idString

The OCID of the Oracle Cloud Infrastructure Vault key used to encrypt the CA.

Returns:

  • (String)


72
73
74
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 72

def kms_key_id
  @kms_key_id
end

#lifecycle_detailsString

Additional information about the current CA lifecycle state.

Returns:

  • (String)


80
81
82
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 80

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current lifecycle state of the certificate authority.

Returns:

  • (String)


76
77
78
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 76

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] A user-friendly name for the CA. Names are unique within a compartment. Avoid entering confidential information. Valid characters include uppercase or lowercase letters, numbers, hyphens, underscores, and periods.

Returns:

  • (String)


52
53
54
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 52

def name
  @name
end

#signing_algorithmString

The algorithm used to sign public key certificates that the CA issues.

Returns:

  • (String)


105
106
107
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 105

def signing_algorithm
  @signing_algorithm
end

#subjectOCI::CertificatesManagement::Models::CertificateSubject



101
102
103
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 101

def subject
  @subject
end

#time_createdDateTime

[Required] A property indicating when the CA was created, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z

Returns:

  • (DateTime)


62
63
64
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 62

def time_created
  @time_created
end

#time_of_deletionDateTime

An optional property indicating when to delete the CA version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z

Returns:

  • (DateTime)


68
69
70
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 68

def time_of_deletion
  @time_of_deletion
end

Class Method Details

.attribute_mapObject

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



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 120

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'issuer_certificate_authority_id': :'issuerCertificateAuthorityId',
    'name': :'name',
    'description': :'description',
    'time_created': :'timeCreated',
    'time_of_deletion': :'timeOfDeletion',
    'kms_key_id': :'kmsKeyId',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'compartment_id': :'compartmentId',
    'certificate_authority_rules': :'certificateAuthorityRules',
    'current_version': :'currentVersion',
    'certificate_revocation_list_details': :'certificateRevocationListDetails',
    'config_type': :'configType',
    'subject': :'subject',
    'signing_algorithm': :'signingAlgorithm',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 146

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'issuer_certificate_authority_id': :'String',
    'name': :'String',
    'description': :'String',
    'time_created': :'DateTime',
    'time_of_deletion': :'DateTime',
    'kms_key_id': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'compartment_id': :'String',
    'certificate_authority_rules': :'Array<OCI::CertificatesManagement::Models::CertificateAuthorityRule>',
    'current_version': :'OCI::CertificatesManagement::Models::CertificateAuthorityVersionSummary',
    'certificate_revocation_list_details': :'OCI::CertificatesManagement::Models::CertificateRevocationListDetails',
    'config_type': :'String',
    'subject': :'OCI::CertificatesManagement::Models::CertificateSubject',
    'signing_algorithm': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 343

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

  self.class == other.class &&
    id == other.id &&
    issuer_certificate_authority_id == other.issuer_certificate_authority_id &&
    name == other.name &&
    description == other.description &&
    time_created == other.time_created &&
    time_of_deletion == other.time_of_deletion &&
    kms_key_id == other.kms_key_id &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    compartment_id == other.compartment_id &&
    certificate_authority_rules == other.certificate_authority_rules &&
    current_version == other.current_version &&
    certificate_revocation_list_details == other.certificate_revocation_list_details &&
    config_type == other.config_type &&
    subject == other.subject &&
    signing_algorithm == other.signing_algorithm &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 390

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


370
371
372
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 370

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



379
380
381
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 379

def hash
  [id, issuer_certificate_authority_id, name, description, time_created, time_of_deletion, kms_key_id, lifecycle_state, lifecycle_details, compartment_id, certificate_authority_rules, current_version, certificate_revocation_list_details, config_type, subject, signing_algorithm, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



423
424
425
426
427
428
429
430
431
432
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 423

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



417
418
419
# File 'lib/oci/certificates_management/models/certificate_authority.rb', line 417

def to_s
  to_hash.to_s
end