Class: OCI::DatabaseToolsRuntime::Models::DatabaseToolsDatabaseApiGatewayConfigGlobal

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb

Overview

The content of a Database Tools database API gateway config global resource. 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

TYPE_ENUM =
[
  TYPE_DEFAULT = 'DEFAULT'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
POOL_ROUTE_ENUM =
[
  POOL_ROUTE_PATH = 'PATH'.freeze,
  POOL_ROUTE_HEADER = 'HEADER'.freeze,
  POOL_ROUTE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DATABASE_API_STATUS_ENUM =
[
  DATABASE_API_STATUS_ENABLED = 'ENABLED'.freeze,
  DATABASE_API_STATUS_DISABLED = 'DISABLED'.freeze,
  DATABASE_API_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
METADATA_SOURCE_ENUM =
[
  METADATA_SOURCE_DATABASE = 'DATABASE'.freeze,
  METADATA_SOURCE_CLOUD = 'CLOUD'.freeze,
  METADATA_SOURCE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DatabaseToolsDatabaseApiGatewayConfigGlobal

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
192
193
194
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
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 163

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

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

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

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

  self.pool_routing_header = attributes[:'poolRoutingHeader'] if attributes[:'poolRoutingHeader']

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

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

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

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

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

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

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

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

  self.http_port = attributes[:'httpPort'] if attributes[:'httpPort']

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

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

  self.https_port = attributes[:'httpsPort'] if attributes[:'httpsPort']

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

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

  self.certificate_bundle = attributes[:'certificateBundle'] if attributes[:'certificateBundle']

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

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

  self.document_root = attributes[:'documentRoot'] if attributes[:'documentRoot']

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

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

  self.advanced_properties = attributes[:'advancedProperties'] if attributes[:'advancedProperties']

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

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

  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_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

Instance Attribute Details

#advanced_propertiesHash<String, String>

Advanced global properties.

Returns:

  • (Hash<String, String>)


77
78
79
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 77

def advanced_properties
  @advanced_properties
end

#certificate_bundleOCI::DatabaseToolsRuntime::Models::DatabaseApiGatewayConfigCertificateBundle



69
70
71
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 69

def certificate_bundle
  @certificate_bundle
end

#database_api_statusString

ORDS database API is a database management and monitoring REST API. Database Actions requires this feature.

Returns:

  • (String)


54
55
56
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 54

def database_api_status
  @database_api_status
end

#document_rootString

The location of the static resources to be served under the / root server path.

Returns:

  • (String)


73
74
75
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 73

def document_root
  @document_root
end

#http_portInteger

Specifies the HTTP listen port. 0 disables HTTP. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024u201365535) is recommended.

Returns:

  • (Integer)


62
63
64
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 62

def http_port
  @http_port
end

#https_portInteger

Specifies the HTTPS listen port. 0 disables HTTPS. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024u201365535) is recommended. ORDS will use a self-signed certificate if a certificate bundle is not provided.

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 66

def https_port
  @https_port
end

#keyString

[Required] A string that uniquely identifies a Database Tools database API gateway config global settings resource.

Returns:

  • (String)


38
39
40
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 38

def key
  @key
end

#metadata_sourceString

The RESTful service definition location.

Returns:

  • (String)


58
59
60
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 58

def 
  @metadata_source
end

#pool_routeString

How the target pool route value is determined for a HTTP request.

Returns:

  • (String)


46
47
48
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 46

def pool_route
  @pool_route
end

#pool_routing_headerString

The request header name providing the pool route value.

Returns:

  • (String)


50
51
52
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 50

def pool_routing_header
  @pool_routing_header
end

#time_createdDateTime

[Required] The time the resource was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 81

def time_created
  @time_created
end

#time_updatedDateTime

[Required] The time the resource was updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


85
86
87
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 85

def time_updated
  @time_updated
end

#typeString

[Required] The type of the Database Tools database API gateway config global settings resource.

Returns:

  • (String)


42
43
44
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 42

def type
  @type
end

Class Method Details

.attribute_mapObject

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



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 88

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'type': :'type',
    'pool_route': :'poolRoute',
    'pool_routing_header': :'poolRoutingHeader',
    'database_api_status': :'databaseApiStatus',
    'metadata_source': :'metadataSource',
    'http_port': :'httpPort',
    'https_port': :'httpsPort',
    'certificate_bundle': :'certificateBundle',
    'document_root': :'documentRoot',
    'advanced_properties': :'advancedProperties',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated'
    # 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.



134
135
136
137
138
139
140
141
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 134

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

  return 'OCI::DatabaseToolsRuntime::Models::DatabaseToolsDatabaseApiGatewayConfigGlobalDefault' if type == 'DEFAULT'

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

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 109

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'type': :'String',
    'pool_route': :'String',
    'pool_routing_header': :'String',
    'database_api_status': :'String',
    'metadata_source': :'String',
    'http_port': :'Integer',
    'https_port': :'Integer',
    'certificate_bundle': :'OCI::DatabaseToolsRuntime::Models::DatabaseApiGatewayConfigCertificateBundle',
    'document_root': :'String',
    'advanced_properties': :'Hash<String, String>',
    'time_created': :'DateTime',
    'time_updated': :'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



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 303

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

  self.class == other.class &&
    key == other.key &&
    type == other.type &&
    pool_route == other.pool_route &&
    pool_routing_header == other.pool_routing_header &&
    database_api_status == other.database_api_status &&
     == other. &&
    http_port == other.http_port &&
    https_port == other.https_port &&
    certificate_bundle == other.certificate_bundle &&
    document_root == other.document_root &&
    advanced_properties == other.advanced_properties &&
    time_created == other.time_created &&
    time_updated == other.time_updated
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



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

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


325
326
327
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 325

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



334
335
336
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 334

def hash
  [key, type, pool_route, pool_routing_header, database_api_status, , http_port, https_port, certificate_bundle, document_root, advanced_properties, time_created, time_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



378
379
380
381
382
383
384
385
386
387
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 378

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



372
373
374
# File 'lib/oci/database_tools_runtime/models/database_tools_database_api_gateway_config_global.rb', line 372

def to_s
  to_hash.to_s
end