Class: OCI::Database::Models::DatabaseConnectionStringProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/database_connection_string_profile.rb

Overview

The connection string profile to allow clients to group, filter and select connection string values based on structured metadata.

Constant Summary collapse

CONSUMER_GROUP_ENUM =
[
  CONSUMER_GROUP_HIGH = 'HIGH'.freeze,
  CONSUMER_GROUP_MEDIUM = 'MEDIUM'.freeze,
  CONSUMER_GROUP_LOW = 'LOW'.freeze,
  CONSUMER_GROUP_TP = 'TP'.freeze,
  CONSUMER_GROUP_TPURGENT = 'TPURGENT'.freeze,
  CONSUMER_GROUP_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PROTOCOL_ENUM =
[
  PROTOCOL_TCP = 'TCP'.freeze,
  PROTOCOL_TCPS = 'TCPS'.freeze,
  PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
TLS_AUTHENTICATION_ENUM =
[
  TLS_AUTHENTICATION_SERVER = 'SERVER'.freeze,
  TLS_AUTHENTICATION_MUTUAL = 'MUTUAL'.freeze,
  TLS_AUTHENTICATION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
HOST_FORMAT_ENUM =
[
  HOST_FORMAT_FQDN = 'FQDN'.freeze,
  HOST_FORMAT_IP = 'IP'.freeze,
  HOST_FORMAT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SESSION_MODE_ENUM =
[
  SESSION_MODE_DIRECT = 'DIRECT'.freeze,
  SESSION_MODE_REDIRECT = 'REDIRECT'.freeze,
  SESSION_MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SYNTAX_FORMAT_ENUM =
[
  SYNTAX_FORMAT_LONG = 'LONG'.freeze,
  SYNTAX_FORMAT_EZCONNECT = 'EZCONNECT'.freeze,
  SYNTAX_FORMAT_EZCONNECTPLUS = 'EZCONNECTPLUS'.freeze,
  SYNTAX_FORMAT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DatabaseConnectionStringProfile

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :value (String)

    The value to assign to the #value property

  • :consumer_group (String)

    The value to assign to the #consumer_group property

  • :protocol (String)

    The value to assign to the #protocol property

  • :tls_authentication (String)

    The value to assign to the #tls_authentication property

  • :host_format (String)

    The value to assign to the #host_format property

  • :session_mode (String)

    The value to assign to the #session_mode property

  • :syntax_format (String)

    The value to assign to the #syntax_format property

  • :is_regional (BOOLEAN)

    The value to assign to the #is_regional property



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
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 140

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

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

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

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

  self.consumer_group = attributes[:'consumerGroup'] if attributes[:'consumerGroup']

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

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

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

  self.tls_authentication = attributes[:'tlsAuthentication'] if attributes[:'tlsAuthentication']

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

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

  self.host_format = attributes[:'hostFormat'] if attributes[:'hostFormat']

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

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

  self.session_mode = attributes[:'sessionMode'] if attributes[:'sessionMode']

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

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

  self.syntax_format = attributes[:'syntaxFormat'] if attributes[:'syntaxFormat']

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

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

  self.is_regional = attributes[:'isRegional'] unless attributes[:'isRegional'].nil?

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

  self.is_regional = attributes[:'is_regional'] unless attributes[:'is_regional'].nil?
end

Instance Attribute Details

#consumer_groupString

Consumer group used by the connection.

Returns:

  • (String)


63
64
65
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 63

def consumer_group
  @consumer_group
end

#display_nameString

[Required] A user-friendly name for the connection.

Returns:

  • (String)


55
56
57
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 55

def display_name
  @display_name
end

#host_formatString

[Required] Host format used in connection string.

Returns:

  • (String)


75
76
77
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 75

def host_format
  @host_format
end

#is_regionalBOOLEAN

True for a regional connection string, applicable to cross-region DG only.

Returns:

  • (BOOLEAN)


89
90
91
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 89

def is_regional
  @is_regional
end

#protocolString

[Required] Protocol used by the connection.

Returns:

  • (String)


67
68
69
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 67

def protocol
  @protocol
end

#session_modeString

[Required] Specifies whether the listener performs a direct hand-off of the session, or redirects the session. In RAC deployments where SCAN is used, sessions are redirected to a Node VIP. Use DIRECT for direct hand-offs. Use REDIRECT to redirect the session.

Returns:

  • (String)


79
80
81
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 79

def session_mode
  @session_mode
end

#syntax_formatString

[Required] Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. Autonomous Database Serverless instances always use the long format.

Returns:

  • (String)


85
86
87
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 85

def syntax_format
  @syntax_format
end

#tls_authenticationString

Specifies whether the TLS handshake is using one-way (SERVER) or mutual (MUTUAL) authentication.

Returns:

  • (String)


71
72
73
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 71

def tls_authentication
  @tls_authentication
end

#valueString

[Required] Connection string value.

Returns:

  • (String)


59
60
61
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 59

def value
  @value
end

Class Method Details

.attribute_mapObject

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



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 92

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'value': :'value',
    'consumer_group': :'consumerGroup',
    'protocol': :'protocol',
    'tls_authentication': :'tlsAuthentication',
    'host_format': :'hostFormat',
    'session_mode': :'sessionMode',
    'syntax_format': :'syntaxFormat',
    'is_regional': :'isRegional'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 109

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'value': :'String',
    'consumer_group': :'String',
    'protocol': :'String',
    'tls_authentication': :'String',
    'host_format': :'String',
    'session_mode': :'String',
    'syntax_format': :'String',
    'is_regional': :'BOOLEAN'
    # 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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 278

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

  self.class == other.class &&
    display_name == other.display_name &&
    value == other.value &&
    consumer_group == other.consumer_group &&
    protocol == other.protocol &&
    tls_authentication == other.tls_authentication &&
    host_format == other.host_format &&
    session_mode == other.session_mode &&
    syntax_format == other.syntax_format &&
    is_regional == other.is_regional
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



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 316

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


296
297
298
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 296

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



305
306
307
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 305

def hash
  [display_name, value, consumer_group, protocol, tls_authentication, host_format, session_mode, syntax_format, is_regional].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



349
350
351
352
353
354
355
356
357
358
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 349

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



343
344
345
# File 'lib/oci/database/models/database_connection_string_profile.rb', line 343

def to_s
  to_hash.to_s
end