# 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_migration_client =
  OCI::DatabaseMigration::DatabaseMigrationClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_migration_response =
  database_migration_client.update_migration(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-migrationId-Value',
    OCI::DatabaseMigration::Models::UpdateMySqlMigrationDetails.new(
      database_combination: 'MYSQL',
      description: 'EXAMPLE-description-Value',
      type: 'OFFLINE',
      display_name: 'EXAMPLE-displayName-Value',
      source_database_connection_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value',
      target_database_connection_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value',
      freeform_tags: {
        'EXAMPLE_KEY_NdXMS' => 'EXAMPLE_VALUE_QxxE5WpchXBPFJfRz855'
      },
      defined_tags: {
        'EXAMPLE_KEY_MawM9' => { 'EXAMPLE_KEY_atIIC' => 'EXAMPLE--Value' }
      },
      data_transfer_medium_details:
        OCI::DatabaseMigration::Models::UpdateMySqlObjectStorageDataTransferMediumDetails
          .new(
          type: 'OBJECT_STORAGE',
          object_storage_bucket:
            OCI::DatabaseMigration::Models::UpdateObjectStoreBucket.new(
              namespace_name: 'EXAMPLE-namespaceName-Value',
              bucket_name: 'EXAMPLE-bucketName-Value'
            )
        ),
      initial_load_settings:
        OCI::DatabaseMigration::Models::UpdateMySqlInitialLoadSettings.new(
          is_consistent: false,
          is_tz_utc: true,
          compatibility: %w[
            FORCE_INNODB
            SKIP_INVALID_ACCOUNTS
            STRIP_DEFINERS
            STRIP_RESTRICTED_GRANTS
            STRIP_TABLESPACES
            IGNORE_WILDCARD_GRANTS
            STRIP_INVALID_GRANTS
          ],
          primary_key_compatibility: 'CREATE_INVISIBLE_PKS',
          is_ignore_existing_objects: false,
          handle_grant_errors: 'IGNORE',
          job_mode: 'SCHEMA'
        ),
      advisor_settings:
        OCI::DatabaseMigration::Models::UpdateMySqlAdvisorSettings.new(
          is_skip_advisor: false, is_ignore_errors: false
        ),
      hub_details:
        OCI::DatabaseMigration::Models::UpdateGoldenGateHubDetails.new(
          rest_admin_credentials:
            OCI::DatabaseMigration::Models::UpdateAdminCredentials.new(
              username: 'EXAMPLE-username-Value',
              password: 'EXAMPLE-password-Value'
            ),
          url: 'EXAMPLE-url-Value',
          compute_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value',
          vault_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value',
          key_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value',
          extract:
            OCI::DatabaseMigration::Models::UpdateExtract.new(
              performance_profile: 'LOW', long_trans_duration: 856
            ),
          replicat:
            OCI::DatabaseMigration::Models::UpdateReplicat.new(
              performance_profile: 'LOW'
            ),
          acceptable_lag: 8
        ),
      ggs_details:
        OCI::DatabaseMigration::Models::UpdateMySqlGgsDeploymentDetails.new(
          replicat:
            OCI::DatabaseMigration::Models::UpdateReplicat.new(
              performance_profile: 'LOW'
            ),
          acceptable_lag: 20
        )
    )
  )

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