# 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
golden_gate_client = OCI::GoldenGate::GoldenGateClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_pipeline_response =
  golden_gate_client.update_pipeline(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-pipelineId-Value',
    OCI::GoldenGate::Models::UpdateZeroEtlPipelineDetails.new(
      recipe_type: 'ZERO_ETL',
      display_name: 'EXAMPLE-displayName-Value',
      description: 'EXAMPLE-description-Value',
      license_model: 'BRING_YOUR_OWN_LICENSE',
      freeform_tags: {
        'EXAMPLE_KEY_z0Znc' => 'EXAMPLE_VALUE_448sPyDvFnO6gzrtSNNZ'
      },
      defined_tags: {
        'EXAMPLE_KEY_iL1qY' => { 'EXAMPLE_KEY_ae8Ih' => 'EXAMPLE--Value' }
      },
      subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
      cpu_core_count: 23,
      is_auto_scaling_enabled: false,
      process_options:
        OCI::GoldenGate::Models::ProcessOptions.new(
          initial_data_load:
            OCI::GoldenGate::Models::InitialDataLoad.new(
              is_initial_load: 'DISABLED',
              action_on_existing_table: 'TRUNCATE',
              initial_load_type: 'DB_LINK',
              adb_wallet_path: 'EXAMPLE-adbWalletPath-Value',
              source_wallet_path: 'EXAMPLE-sourceWalletPath-Value',
              target_wallet_path: 'EXAMPLE-targetWalletPath-Value',
              namespace_name: 'EXAMPLE-namespaceName-Value',
              bucket_name: 'EXAMPLE-bucketName-Value'
            ),
          replicate_schema_change:
            OCI::GoldenGate::Models::ReplicateSchemaChange.new(
              can_replicate_schema_change: 'DISABLED',
              action_on_ddl_error: 'IGNORE',
              action_on_dml_error: 'IGNORE'
            ),
          should_restart_on_failure: 'DISABLED',
          start_using_default_mapping: 'ENABLED'
        ),
      mapping_rules: [
        OCI::GoldenGate::Models::MappingRule.new(
          mapping_type: 'EXCLUDE',
          source: 'EXAMPLE-source-Value',
          target: 'EXAMPLE-target-Value'
        )
      ]
    )
  )

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