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

namespace Oci.Sdk.DotNet.Example.Datascience
{
    public class UpdateModelDeploymentExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updateModelDeploymentDetails = new Oci.DatascienceService.Models.UpdateModelDeploymentDetails
			{
				DisplayName = "EXAMPLE-displayName-Value",
				Description = "EXAMPLE-description-Value",
				ModelDeploymentConfigurationDetails = new Oci.DatascienceService.Models.UpdateSingleModelDeploymentFlexConfigurationDetails
				{
					ModelConfigurationDetails = new Oci.DatascienceService.Models.UpdateSingleModelConfigurationDetails
					{
						ModelId = "ocid1.test.oc1..<unique_ID>EXAMPLE-modelId-Value"
					},
					InfrastructureConfigurationDetails = new Oci.DatascienceService.Models.UpdateManagedComputeClusterModelDeployInfrastructureConfigDetails
					{
						ComputeTargetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-computeTargetId-Value",
						ModelDeploymentResourceConfiguration = new Oci.DatascienceService.Models.ManagedComputeClusterModelDeploymentResourceConfiguration
						{
							ResourceRequestConfiguration = new Oci.DatascienceService.Models.ResourceRequestConfiguration
							{
								Ocpus = (float)4096.3315,
								MemoryInGBs = (float)7016.9526,
								Gpus = 736
							},
							ResourceLimitConfiguration = new Oci.DatascienceService.Models.ResourceLimitConfiguration
							{
								Ocpus = (float)9366.651,
								MemoryInGBs = (float)6352.548
							}
						},
						ScalingPolicy = new Oci.DatascienceService.Models.ManagedComputeClusterWorkloadFixedSizeScalingPolicy
						{
							InstanceCount = 565
						}
					},
					EnvironmentConfigurationDetails = new Oci.DatascienceService.Models.UpdateDefaultModelDeploymentEnvironmentConfigurationDetails
					{
						EnvironmentVariables = new Dictionary<string, string>()
						{
							{
								"EXAMPLE_KEY_wZRO6", 
								"EXAMPLE_VALUE_gJjSFOIzSRscvN4J8FUS"
							}
						}
					}
				},
				CategoryLogDetails = new Oci.DatascienceService.Models.UpdateCategoryLogDetails
				{
					Access = new Oci.DatascienceService.Models.LogDetails
					{
						LogId = "ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value",
						LogGroupId = "ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value"
					},
					Predict = new Oci.DatascienceService.Models.LogDetails
					{
						LogId = "ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value",
						LogGroupId = "ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value"
					}
				},
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_9cRu4", 
						"EXAMPLE_VALUE_d1SruB2SoNZVVdYMLmiB"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_2Y9O1", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_iekv9", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var updateModelDeploymentRequest = new Oci.DatascienceService.Requests.UpdateModelDeploymentRequest
			{
				ModelDeploymentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-modelDeploymentId-Value",
				UpdateModelDeploymentDetails = updateModelDeploymentDetails,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRequestId = "QTPE0FKIVTCIQNBSYUE6<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 DataScienceClient(provider, new ClientConfiguration()))
				{
					var response = await client.UpdateModelDeployment(updateModelDeploymentRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdateModelDeployment Failed with {e.Message}");
                throw e;
            }
        }

    }
}