Class: OCI::DataSafe::Models::TlsConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/tls_config.rb

Overview

The details required to establish a TLS enabled connection.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_ENABLED = 'ENABLED'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CERTIFICATE_STORE_TYPE_ENUM =
[
  CERTIFICATE_STORE_TYPE_JKS = 'JKS'.freeze,
  CERTIFICATE_STORE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TlsConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :status (String)

    The value to assign to the #status property

  • :certificate_store_type (String)

    The value to assign to the #certificate_store_type property

  • :store_password (String)

    The value to assign to the #store_password property

  • :trust_store_content (String)

    The value to assign to the #trust_store_content property

  • :key_store_content (String)

    The value to assign to the #key_store_content property



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/data_safe/models/tls_config.rb', line 80

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

  self.certificate_store_type = attributes[:'certificateStoreType'] if attributes[:'certificateStoreType']

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

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

  self.store_password = attributes[:'storePassword'] if attributes[:'storePassword']

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

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

  self.trust_store_content = attributes[:'trustStoreContent'] if attributes[:'trustStoreContent']

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

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

  self.key_store_content = attributes[:'keyStoreContent'] if attributes[:'keyStoreContent']

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

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

Instance Attribute Details

#certificate_store_typeString

The format of the certificate store.

Returns:

  • (String)


29
30
31
# File 'lib/oci/data_safe/models/tls_config.rb', line 29

def certificate_store_type
  @certificate_store_type
end

#key_store_contentString

Base64 encoded string of key store file content.

Returns:

  • (String)


41
42
43
# File 'lib/oci/data_safe/models/tls_config.rb', line 41

def key_store_content
  @key_store_content
end

#statusString

[Required] Status to represent whether the database connection is TLS enabled or not.

Returns:

  • (String)


25
26
27
# File 'lib/oci/data_safe/models/tls_config.rb', line 25

def status
  @status
end

#store_passwordString

The password to read the trust store and key store files, if they are password protected.

Returns:

  • (String)


33
34
35
# File 'lib/oci/data_safe/models/tls_config.rb', line 33

def store_password
  @store_password
end

#trust_store_contentString

Base64 encoded string of trust store file content.

Returns:

  • (String)


37
38
39
# File 'lib/oci/data_safe/models/tls_config.rb', line 37

def trust_store_content
  @trust_store_content
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/oci/data_safe/models/tls_config.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'status',
    'certificate_store_type': :'certificateStoreType',
    'store_password': :'storePassword',
    'trust_store_content': :'trustStoreContent',
    'key_store_content': :'keyStoreContent'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/data_safe/models/tls_config.rb', line 57

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'String',
    'certificate_store_type': :'String',
    'store_password': :'String',
    'trust_store_content': :'String',
    'key_store_content': :'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



146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/data_safe/models/tls_config.rb', line 146

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

  self.class == other.class &&
    status == other.status &&
    certificate_store_type == other.certificate_store_type &&
    store_password == other.store_password &&
    trust_store_content == other.trust_store_content &&
    key_store_content == other.key_store_content
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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/data_safe/models/tls_config.rb', line 180

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


160
161
162
# File 'lib/oci/data_safe/models/tls_config.rb', line 160

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



169
170
171
# File 'lib/oci/data_safe/models/tls_config.rb', line 169

def hash
  [status, certificate_store_type, store_password, trust_store_content, key_store_content].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/data_safe/models/tls_config.rb', line 213

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



207
208
209
# File 'lib/oci/data_safe/models/tls_config.rb', line 207

def to_s
  to_hash.to_s
end