// 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.DevopsService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Devops
{
    public class TriggerDeploymentDryRunExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var triggerDeploymentDryRunDetails = new Oci.DevopsService.Models.TriggerDeploymentDryRunDetails
			{
				HelmDiffArguments = new Oci.DevopsService.Models.HelmDiffArgumentCollection
				{
					Items = new List<Oci.DevopsService.Models.HelmDiffArgument>
					{
						new Oci.DevopsService.Models.HelmDiffArgument
						{
							StageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-stageId-Value",
							HelmArgSetValues = new Oci.DevopsService.Models.HelmSetValueCollection
							{
								Items = new List<Oci.DevopsService.Models.HelmSetValue>
								{
									new Oci.DevopsService.Models.HelmSetValue
									{
										Name = "EXAMPLE-name-Value",
										Value = "EXAMPLE-value-Value"
									}
								}
							},
							HelmArgStringValues = new Oci.DevopsService.Models.HelmSetValueCollection
							{
								Items = new List<Oci.DevopsService.Models.HelmSetValue>
								{
									new Oci.DevopsService.Models.HelmSetValue
									{
										Name = "EXAMPLE-name-Value",
										Value = "EXAMPLE-value-Value"
									}
								}
							},
							ValueArtifactContents = new Oci.DevopsService.Models.ValueArtifactContentCollection
							{
								Items = new List<Oci.DevopsService.Models.ValueArtifactContent>
								{
									new Oci.DevopsService.Models.ValueArtifactContent
									{
										Name = "EXAMPLE-name-Value",
										Value = "EXAMPLE-value-Value"
									}
								}
							},
							HelmStageContents = new List<Oci.DevopsService.Models.HelmStageContent>
							{
								new Oci.DevopsService.Models.HelmStageContent
								{
									Name = "EXAMPLE-name-Value",
									Value = "EXAMPLE-value-Value"
								}
							}
						}
					}
				},
				CreateDeploymentDetails = new Oci.DevopsService.Models.CreateSingleDeployStageDeploymentDetails
				{
					DeployStageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-deployStageId-Value",
					DeploymentArguments = new Oci.DevopsService.Models.DeploymentArgumentCollection
					{
						Items = new List<Oci.DevopsService.Models.DeploymentArgument>
						{
							new Oci.DevopsService.Models.DeploymentArgument
							{
								Name = "EXAMPLE-name-Value",
								Value = "EXAMPLE-value-Value"
							}
						}
					},
					DeployStageOverrideArguments = new Oci.DevopsService.Models.DeployStageOverrideArgumentCollection
					{
						Items = new List<Oci.DevopsService.Models.DeployStageOverrideArgument>
						{
							new Oci.DevopsService.Models.DeployStageOverrideArgument
							{
								DeployStageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-deployStageId-Value",
								Name = "EXAMPLE-name-Value",
								Value = "EXAMPLE-value-Value"
							}
						}
					},
					DeployArtifactOverrideArguments = new Oci.DevopsService.Models.DeployArtifactOverrideArgumentCollection
					{
						Items = new List<Oci.DevopsService.Models.DeployArtifactOverrideArgument>
						{
							new Oci.DevopsService.Models.DeployArtifactOverrideArgument
							{
								DeployArtifactId = "ocid1.test.oc1..<unique_ID>EXAMPLE-deployArtifactId-Value",
								Name = "EXAMPLE-name-Value",
								Value = "EXAMPLE-value-Value"
							}
						}
					},
					DeployPipelineId = "ocid1.test.oc1..<unique_ID>EXAMPLE-deployPipelineId-Value",
					DisplayName = "EXAMPLE-displayName-Value",
					FreeformTags = new Dictionary<string, string>()
					{
						{
							"EXAMPLE_KEY_5yWuQ", 
							"EXAMPLE_VALUE_DzSDKhGywjpXjWSJ2w27"
						}
					},
					DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
					{
						{
							"EXAMPLE_KEY_Sukc6", 
							new Dictionary<string, Object>()
							{
								{
									"EXAMPLE_KEY_e7ods", 
									"EXAMPLE--Value"
								}
							}
						}
					}
				}
			};
			var triggerDeploymentDryRunRequest = new Oci.DevopsService.Requests.TriggerDeploymentDryRunRequest
			{
				TriggerDeploymentDryRunDetails = triggerDeploymentDryRunDetails,
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "TTDYC2IKI8X0559KVANP<unique_ID>"
			};

            // 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 DevopsClient(provider, new ClientConfiguration()))
				{
					var response = await client.TriggerDeploymentDryRun(triggerDeploymentDryRunRequest);
					// Retrieve value from the response.
					var deploymentIdValue = response.TriggerDryRunResult.DeploymentId;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"TriggerDeploymentDryRun Failed with {e.Message}");
                throw e;
            }
        }

    }
}