class OCI::Database::Models::ExternalContainerDatabase

An Oracle Cloud Infrastructure resource that allows you to manage an external container database.

Constants

DATABASE_CONFIGURATION_ENUM
DATABASE_EDITION_ENUM
LIFECYCLE_STATE_ENUM

Attributes

character_set[RW]

The character set of the external database. @return [String]

compartment_id[RW]

[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. @return [String]

database_configuration[R]

The Oracle Database configuration @return [String]

database_edition[R]

The Oracle Database edition.

@return [String]

database_management_config[RW]

@return [OCI::Database::Models::DatabaseManagementConfig]

database_version[RW]

The Oracle Database version. @return [String]

db_id[RW]

The Oracle Database ID, which identifies an Oracle Database located outside of Oracle Cloud.

@return [String]

db_packs[RW]

The database packs licensed for the external Oracle Database. @return [String]

db_unique_name[RW]

The `DB_UNIQUE_NAME` of the external database. @return [String]

defined_tags[RW]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).

@return [Hash<String, Hash<String, Object>>]

display_name[RW]

[Required] The user-friendly name for the external database. The name does not have to be unique. @return [String]

freeform_tags[RW]

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).

Example: `{"Department": "Finance"}`

@return [Hash<String, String>]

id[RW]

[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure external database resource.

@return [String]

lifecycle_details[RW]

Additional information about the current lifecycle state. @return [String]

lifecycle_state[R]

[Required] The current state of the Oracle Cloud Infrastructure external database resource. @return [String]

ncharacter_set[RW]

The national character of the external database. @return [String]

time_created[RW]

[Required] The date and time the database was created. @return [DateTime]

time_zone[RW]

The time zone of the external database. It is a time zone offset (a character type in the format '[+|-]TZH:TZM') or a time zone region name, depending on how the time zone value was specified when the database was created / last altered.

@return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/database/models/external_container_database.rb, line 121
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'id': :'id',
    'lifecycle_details': :'lifecycleDetails',
    'lifecycle_state': :'lifecycleState',
    'time_created': :'timeCreated',
    'db_unique_name': :'dbUniqueName',
    'db_id': :'dbId',
    'database_version': :'databaseVersion',
    'database_edition': :'databaseEdition',
    'time_zone': :'timeZone',
    'character_set': :'characterSet',
    'ncharacter_set': :'ncharacterSet',
    'db_packs': :'dbPacks',
    'database_configuration': :'databaseConfiguration',
    'database_management_config': :'databaseManagementConfig'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :id The value to assign to the {#id} property @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [String] :db_unique_name The value to assign to the {#db_unique_name} property @option attributes [String] :db_id The value to assign to the {#db_id} property @option attributes [String] :database_version The value to assign to the {#database_version} property @option attributes [String] :database_edition The value to assign to the {#database_edition} property @option attributes [String] :time_zone The value to assign to the {#time_zone} property @option attributes [String] :character_set The value to assign to the {#character_set} property @option attributes [String] :ncharacter_set The value to assign to the {#ncharacter_set} property @option attributes [String] :db_packs The value to assign to the {#db_packs} property @option attributes [String] :database_configuration The value to assign to the {#database_configuration} property @option attributes [OCI::Database::Models::DatabaseManagementConfig] :database_management_config The value to assign to the {#database_management_config} property

# File lib/oci/database/models/external_container_database.rb, line 196
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

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

  self.db_id = attributes[:'dbId'] if attributes[:'dbId']

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

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

  self.database_version = attributes[:'databaseVersion'] if attributes[:'databaseVersion']

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

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

  self.database_edition = attributes[:'databaseEdition'] if attributes[:'databaseEdition']

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

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

  self.time_zone = attributes[:'timeZone'] if attributes[:'timeZone']

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

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

  self.character_set = attributes[:'characterSet'] if attributes[:'characterSet']

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

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

  self.ncharacter_set = attributes[:'ncharacterSet'] if attributes[:'ncharacterSet']

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

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

  self.db_packs = attributes[:'dbPacks'] if attributes[:'dbPacks']

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

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

  self.database_configuration = attributes[:'databaseConfiguration'] if attributes[:'databaseConfiguration']

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

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

  self.database_management_config = attributes[:'databaseManagementConfig'] if attributes[:'databaseManagementConfig']

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

  self.database_management_config = attributes[:'database_management_config'] if attributes[:'database_management_config']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/database/models/external_container_database.rb, line 147
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'id': :'String',
    'lifecycle_details': :'String',
    'lifecycle_state': :'String',
    'time_created': :'DateTime',
    'db_unique_name': :'String',
    'db_id': :'String',
    'database_version': :'String',
    'database_edition': :'String',
    'time_zone': :'String',
    'character_set': :'String',
    'ncharacter_set': :'String',
    'db_packs': :'String',
    'database_configuration': :'String',
    'database_management_config': :'OCI::Database::Models::DatabaseManagementConfig'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/database/models/external_container_database.rb, line 350
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    id == other.id &&
    lifecycle_details == other.lifecycle_details &&
    lifecycle_state == other.lifecycle_state &&
    time_created == other.time_created &&
    db_unique_name == other.db_unique_name &&
    db_id == other.db_id &&
    database_version == other.database_version &&
    database_edition == other.database_edition &&
    time_zone == other.time_zone &&
    character_set == other.character_set &&
    ncharacter_set == other.ncharacter_set &&
    db_packs == other.db_packs &&
    database_configuration == other.database_configuration &&
    database_management_config == other.database_management_config
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/database/models/external_container_database.rb, line 397
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
database_configuration=(database_configuration) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] database_configuration Object to be assigned

# File lib/oci/database/models/external_container_database.rb, line 334
def database_configuration=(database_configuration)
  # rubocop:disable Style/ConditionalAssignment
  if database_configuration && !DATABASE_CONFIGURATION_ENUM.include?(database_configuration)
    OCI.logger.debug("Unknown value for 'database_configuration' [" + database_configuration + "]. Mapping to 'DATABASE_CONFIGURATION_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @database_configuration = DATABASE_CONFIGURATION_UNKNOWN_ENUM_VALUE
  else
    @database_configuration = database_configuration
  end
  # rubocop:enable Style/ConditionalAssignment
end
database_edition=(database_edition) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] database_edition Object to be assigned

# File lib/oci/database/models/external_container_database.rb, line 321
def database_edition=(database_edition)
  # rubocop:disable Style/ConditionalAssignment
  if database_edition && !DATABASE_EDITION_ENUM.include?(database_edition)
    OCI.logger.debug("Unknown value for 'database_edition' [" + database_edition + "]. Mapping to 'DATABASE_EDITION_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @database_edition = DATABASE_EDITION_UNKNOWN_ENUM_VALUE
  else
    @database_edition = database_edition
  end
  # rubocop:enable Style/ConditionalAssignment
end
eql?(other) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/database/models/external_container_database.rb, line 377
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/database/models/external_container_database.rb, line 386
def hash
  [compartment_id, freeform_tags, defined_tags, display_name, id, lifecycle_details, lifecycle_state, time_created, db_unique_name, db_id, database_version, database_edition, time_zone, character_set, ncharacter_set, db_packs, database_configuration, database_management_config].hash
end
lifecycle_state=(lifecycle_state) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] lifecycle_state Object to be assigned

# File lib/oci/database/models/external_container_database.rb, line 308
def lifecycle_state=(lifecycle_state)
  # rubocop:disable Style/ConditionalAssignment
  if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
    OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
  else
    @lifecycle_state = lifecycle_state
  end
  # rubocop:enable Style/ConditionalAssignment
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/database/models/external_container_database.rb, line 430
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/database/models/external_container_database.rb, line 424
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/database/models/external_container_database.rb, line 447
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end