// 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/cloudmigrations"
	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateTargetAsset() {
	// 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 := cloudmigrations.NewMigrationClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

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

	req := cloudmigrations.UpdateTargetAssetRequest{OpcRequestId: common.String("SFLYHZI0FGXCJSARJJHL<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		TargetAssetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-targetAssetId-Value"),
		UpdateTargetAssetDetails: cloudmigrations.UpdateVmTargetAssetDetails{IsExcludedFromExecution: common.Bool(true),
			MsLicense:          common.String("EXAMPLE-msLicense-Value"),
			PreferredShapeType: cloudmigrations.VmTargetAssetPreferredShapeTypeVmIntelDensio,
			UserSpec: &cloudmigrations.LaunchInstanceDetails{DedicatedVmHostId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-dedicatedVmHostId-Value"),
				IpxeScript:                     common.String("EXAMPLE-ipxeScript-Value"),
				IsPvEncryptionInTransitEnabled: common.Bool(false),
				AgentConfig: &cloudmigrations.LaunchInstanceAgentConfigDetails{AreAllPluginsDisabled: common.Bool(true),
					IsManagementDisabled: common.Bool(true),
					IsMonitoringDisabled: common.Bool(false),
					PluginsConfig: []cloudmigrations.InstanceAgentPluginConfigDetails{cloudmigrations.InstanceAgentPluginConfigDetails{DesiredState: cloudmigrations.InstanceAgentPluginConfigDetailsDesiredStateDisabled,
						Name: common.String("EXAMPLE-name-Value")}}},
				AvailabilityDomain:    common.String("EXAMPLE-availabilityDomain-Value"),
				CapacityReservationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value"),
				DisplayName:           common.String("EXAMPLE-displayName-Value"),
				ShapeConfig: &cloudmigrations.LaunchInstanceShapeConfigDetails{BaselineOcpuUtilization: cloudmigrations.LaunchInstanceShapeConfigDetailsBaselineOcpuUtilization2,
					MemoryInGBs: common.Float32(5965.0527),
					Ocpus:       common.Float32(8409.596)},
				DefinedTags:               map[string]map[string]interface{}{"EXAMPLE_KEY_V2eqV": map[string]interface{}{"EXAMPLE_KEY_lfWH0": "EXAMPLE--Value"}},
				FaultDomain:               common.String("EXAMPLE-faultDomain-Value"),
				PreemptibleInstanceConfig: &cloudmigrations.PreemptibleInstanceConfigDetails{PreemptionAction: cloudmigrations.TerminatePreemptionAction{PreserveBootVolume: common.Bool(false)}},
				Shape:                     common.String("EXAMPLE-shape-Value"),
				SourceDetails:             cloudmigrations.InstanceSourceViaBootVolumeDetails{BootVolumeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-bootVolumeId-Value")},
				CompartmentId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
				CreateVnicDetails: &cloudmigrations.CreateVnicDetails{SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
					AssignPublicIp:         common.Bool(false),
					DefinedTags:            map[string]map[string]interface{}{"EXAMPLE_KEY_6b7HJ": map[string]interface{}{"EXAMPLE_KEY_6wcDC": "EXAMPLE--Value"}},
					HostnameLabel:          common.String("EXAMPLE-hostnameLabel-Value"),
					PrivateIp:              common.String("EXAMPLE-privateIp-Value"),
					SkipSourceDestCheck:    common.Bool(true),
					VlanId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value"),
					AssignPrivateDnsRecord: common.Bool(true),
					DisplayName:            common.String("EXAMPLE-displayName-Value"),
					FreeformTags:           map[string]string{"EXAMPLE_KEY_bU2QE": "EXAMPLE_VALUE_UvGisU7pluBQvJVmR8XF"},
					NsgIds:                 []string{"EXAMPLE--Value"}},
				FreeformTags:    map[string]string{"EXAMPLE_KEY_Peb3k": "EXAMPLE_VALUE_tpVRiYjxoDqnkYN2JqIF"},
				HostnameLabel:   common.String("EXAMPLE-hostnameLabel-Value"),
				InstanceOptions: &cloudmigrations.InstanceOptions{AreLegacyImdsEndpointsDisabled: common.Bool(true)}},
			BlockVolumesPerformance: common.Int(132)},
		IfMatch: common.String("EXAMPLE-ifMatch-Value")}

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

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