# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

require 'oci'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
database_tools_client =
  OCI::DatabaseTools::DatabaseToolsClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_database_tools_connection_response =
  database_tools_client.update_database_tools_connection(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-databaseToolsConnectionId-Value',
    OCI::DatabaseTools::Models::UpdateDatabaseToolsConnectionOracleDatabaseDetails
      .new(
      type: 'ORACLE_DATABASE',
      display_name: 'EXAMPLE-displayName-Value',
      defined_tags: {
        'EXAMPLE_KEY_bRKDw' => { 'EXAMPLE_KEY_kWoDT' => 'EXAMPLE--Value' }
      },
      freeform_tags: {
        'EXAMPLE_KEY_UUBKz' => 'EXAMPLE_VALUE_AEMnlSkI1l0DR7vOE6UC'
      },
      related_resource:
        OCI::DatabaseTools::Models::UpdateDatabaseToolsRelatedResourceDetails
          .new(
          entity_type: 'PLUGGABLEDATABASE',
          identifier: 'EXAMPLE-identifier-Value'
        ),
      connection_string: 'EXAMPLE-connectionString-Value',
      user_name: 'EXAMPLE-userName-Value',
      user_password:
        OCI::DatabaseTools::Models::DatabaseToolsUserPasswordSecretIdDetails
          .new(
          value_type: 'SECRETID',
          secret_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value'
        ),
      advanced_properties: {
        'EXAMPLE_KEY_0tRTg' => 'EXAMPLE_VALUE_XswvlXQmCoDexK3vX7T1'
      },
      key_stores: [
        OCI::DatabaseTools::Models::DatabaseToolsKeyStoreDetails.new(
          key_store_type: 'PKCS12',
          key_store_content:
            OCI::DatabaseTools::Models::DatabaseToolsKeyStoreContentSecretIdDetails
              .new(
              value_type: 'SECRETID',
              secret_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value'
            ),
          key_store_password:
            OCI::DatabaseTools::Models::DatabaseToolsKeyStorePasswordSecretIdDetails
              .new(
              value_type: 'SECRETID',
              secret_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value'
            )
        )
      ],
      private_endpoint_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value',
      proxy_client:
        OCI::DatabaseTools::Models::DatabaseToolsConnectionOracleDatabaseProxyClientNoProxyDetails
          .new(proxy_authentication_type: 'NO_PROXY')
    )
  )

# Get the data from response
puts "#{update_database_tools_connection_response.headers}"