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

package main

import (
	"context"
	"fmt"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/datascience"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateModelDeployment() {
	// 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.
	client, err := datascience.NewDataScienceClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := datascience.UpdateModelDeploymentRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		ModelDeploymentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-modelDeploymentId-Value"),
		OpcRequestId:      common.String("SQSSTZ3V7O3JEYOLHEH4<unique_ID>"),
		UpdateModelDeploymentDetails: datascience.UpdateModelDeploymentDetails{FreeformTags: map[string]string{"EXAMPLE_KEY_YUeiG": "EXAMPLE_VALUE_j5qvEs9BPtc2vwMXKUm8"},
			ModelDeploymentConfigurationDetails: datascience.UpdateSingleModelDeploymentConfigurationDetails{ModelConfigurationDetails: &datascience.UpdateModelConfigurationDetails{ModelId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-modelId-Value"),
				ScalingPolicy: datascience.AutoScalingPolicy{AutoScalingPolicies: []datascience.AutoScalingPolicyDetails{datascience.ThresholdBasedAutoScalingPolicyDetails{InitialInstanceCount: common.Int(264),
					MaximumInstanceCount: common.Int(7),
					MinimumInstanceCount: common.Int(889),
					Rules: []datascience.MetricExpressionRule{datascience.PredefinedMetricExpressionRule{MetricType: datascience.PredefinedMetricExpressionRuleMetricTypeMemoryUtilization,
						ScaleInConfiguration: &datascience.PredefinedExpressionThresholdScalingConfiguration{InstanceCountAdjustment: common.Int(603),
							PendingDuration: common.String("EXAMPLE-pendingDuration-Value"),
							Threshold:       common.Int(483)}}}}},
					CoolDownInSeconds: common.Int(661),
					IsEnabled:         common.Bool(false)},
				BandwidthMbps: common.Int(3752),
				InstanceConfiguration: &datascience.InstanceConfiguration{SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
					InstanceShapeName: common.String("EXAMPLE-instanceShapeName-Value"),
					ModelDeploymentInstanceShapeConfigDetails: &datascience.ModelDeploymentInstanceShapeConfigDetails{Ocpus: common.Float32(53.34189),
						CpuBaseline: datascience.ModelDeploymentInstanceShapeConfigDetailsCpuBaseline8,
						MemoryInGBs: common.Float32(99.02582)},
					PrivateEndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value")},
				MaximumBandwidthMbps: common.Int(6785)},
				EnvironmentConfigurationDetails: datascience.UpdateDefaultModelDeploymentEnvironmentConfigurationDetails{EnvironmentVariables: map[string]string{"EXAMPLE_KEY_6OvqY": "EXAMPLE_VALUE_2idbjGVULt06i5jiU41A"}}},
			CategoryLogDetails: &datascience.UpdateCategoryLogDetails{Access: &datascience.LogDetails{LogGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value"),
				LogId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value")},
				Predict: &datascience.LogDetails{LogGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value"),
					LogId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value")}},
			DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_70gvl": map[string]interface{}{"EXAMPLE_KEY_wGlSP": "EXAMPLE--Value"}},
			Description: common.String("EXAMPLE-description-Value"),
			DisplayName: common.String("EXAMPLE-displayName-Value")}}

	// Send the request using the service client
	resp, err := client.UpdateModelDeployment(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}