Class: OCI::CertificatesManagement::Models::UpdateCertificateConfigDetails

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

Overview

The details of the contents of the certificate and certificate metadata. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

CONFIG_TYPE_ENUM =
[
  CONFIG_TYPE_ISSUED_BY_INTERNAL_CA = 'ISSUED_BY_INTERNAL_CA'.freeze,
  CONFIG_TYPE_MANAGED_EXTERNALLY_ISSUED_BY_INTERNAL_CA = 'MANAGED_EXTERNALLY_ISSUED_BY_INTERNAL_CA'.freeze,
  CONFIG_TYPE_IMPORTED = 'IMPORTED'.freeze
].freeze
STAGE_ENUM =
[
  STAGE_CURRENT = 'CURRENT'.freeze,
  STAGE_PENDING = 'PENDING'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateCertificateConfigDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :config_type (String)

    The value to assign to the #config_type property

  • :version_name (String)

    The value to assign to the #version_name property

  • :stage (String)

    The value to assign to the #stage property



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 86

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

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

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

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

Instance Attribute Details

#config_typeString

[Required] The origin of the certificate.

Returns:

  • (String)


25
26
27
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 25

def config_type
  @config_type
end

#stageString

The rotation state of the certificate. The default is CURRENT, meaning that the certificate is currently in use. A certificate version that you mark as PENDING is staged and available for use, but you don't yet want to rotate it into current, active use. For example, you might update a certificate and mark its rotation state as PENDING if you haven't yet updated the certificate on the target system.

Returns:

  • (String)


36
37
38
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 36

def stage
  @stage
end

#version_nameString

A name for the certificate version. When the value is not null, a name is unique across versions of a given certificate.

Returns:

  • (String)


29
30
31
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 29

def version_name
  @version_name
end

Class Method Details

.attribute_mapObject

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



39
40
41
42
43
44
45
46
47
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 39

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'configType',
    'version_name': :'versionName',
    'stage': :'stage'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 65

def self.get_subtype(object_hash)
  type = object_hash[:'configType'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::CertificatesManagement::Models::UpdateCertificateByImportingConfigDetails' if type == 'IMPORTED'
  return 'OCI::CertificatesManagement::Models::UpdateCertificateIssuedByInternalCaConfigDetails' if type == 'ISSUED_BY_INTERNAL_CA'
  return 'OCI::CertificatesManagement::Models::UpdateCertificateManagedExternallyIssuedByInternalCaConfigDetails' if type == 'MANAGED_EXTERNALLY_ISSUED_BY_INTERNAL_CA'

  # TODO: Log a warning when the subtype is not found.
  'OCI::CertificatesManagement::Models::UpdateCertificateConfigDetails'
end

.swagger_typesObject

Attribute type mapping.



50
51
52
53
54
55
56
57
58
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 50

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'String',
    'version_name': :'String',
    'stage': :'String'
    # 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



133
134
135
136
137
138
139
140
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 133

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

  self.class == other.class &&
    config_type == other.config_type &&
    version_name == other.version_name &&
    stage == other.stage
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



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 165

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


145
146
147
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 145

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



154
155
156
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 154

def hash
  [config_type, version_name, stage].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



198
199
200
201
202
203
204
205
206
207
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 198

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



192
193
194
# File 'lib/oci/certificates_management/models/update_certificate_config_details.rb', line 192

def to_s
  to_hash.to_s
end