// 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).

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.GoldengateService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Goldengate
{
    public class UpdatePipelineExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updatePipelineDetails = new Oci.GoldengateService.Models.UpdateZeroEtlPipelineDetails
			{
				ProcessOptions = new Oci.GoldengateService.Models.ProcessOptions
				{
					InitialDataLoad = new Oci.GoldengateService.Models.InitialDataLoad
					{
						IsInitialLoad = Oci.GoldengateService.Models.InitialDataLoad.IsInitialLoadEnum.Enabled,
						ActionOnExistingTable = Oci.GoldengateService.Models.InitialLoadAction.Replace
					},
					ReplicateSchemaChange = new Oci.GoldengateService.Models.ReplicateSchemaChange
					{
						CanReplicateSchemaChange = Oci.GoldengateService.Models.ReplicateSchemaChange.CanReplicateSchemaChangeEnum.Enabled,
						ActionOnDdlError = Oci.GoldengateService.Models.ReplicateDdlErrorAction.Discard,
						ActionOnDmlError = Oci.GoldengateService.Models.ReplicateDmlErrorAction.Terminate
					},
					ShouldRestartOnFailure = Oci.GoldengateService.Models.ProcessOptions.ShouldRestartOnFailureEnum.Disabled,
					StartUsingDefaultMapping = Oci.GoldengateService.Models.ProcessOptions.StartUsingDefaultMappingEnum.Disabled
				},
				MappingRules = new List<Oci.GoldengateService.Models.MappingRule>
				{
					new Oci.GoldengateService.Models.MappingRule
					{
						MappingType = Oci.GoldengateService.Models.MappingType.Exclude,
						Source = "EXAMPLE-source-Value",
						Target = "EXAMPLE-target-Value"
					}
				},
				DisplayName = "EXAMPLE-displayName-Value",
				Description = "EXAMPLE-description-Value",
				LicenseModel = Oci.GoldengateService.Models.LicenseModel.LicenseIncluded,
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_bfm8K", 
						"EXAMPLE_VALUE_4BDnCHNp3IGlX7nEzK9Q"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_wookW", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_wQLzQ", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var updatePipelineRequest = new Oci.GoldengateService.Requests.UpdatePipelineRequest
			{
				PipelineId = "ocid1.test.oc1..<unique_ID>EXAMPLE-pipelineId-Value",
				UpdatePipelineDetails = updatePipelineDetails,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRequestId = "ZOR7JKWOHWO5LV9IIQSV<unique_ID>",
				IsLockOverride = false
			};

            // Create a default authentication provider that uses the DEFAULT
            // profile in the configuration file.
            // Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new GoldenGateClient(provider, new ClientConfiguration()))
				{
					var response = await client.UpdatePipeline(updatePipelineRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdatePipeline Failed with {e.Message}");
                throw e;
            }
        }

    }
}

Was this article helpful?