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

func ExampleCreateAsset() {
	// 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 := cloudbridge.NewInventoryClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

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

	req := cloudbridge.CreateAssetRequest{CreateAssetDetails: cloudbridge.CreateVmwareVmAssetDetails{DisplayName: common.String("EXAMPLE-displayName-Value"),
		ExternalAssetKey: common.String("EXAMPLE-externalAssetKey-Value"),
		FreeformTags:     map[string]string{"EXAMPLE_KEY_Ku4pP": "EXAMPLE_VALUE_X6MxrQvUnoERZMrhSn0h"},
		VmwareVCenter: &cloudbridge.VmwareVCenterProperties{DataCenter: common.String("EXAMPLE-dataCenter-Value"),
			VcenterKey:     common.String("EXAMPLE-vcenterKey-Value"),
			VcenterVersion: common.String("EXAMPLE-vcenterVersion-Value")},
		VmwareVm: &cloudbridge.VmwareVmProperties{IsDisksUuidEnabled: common.Bool(true),
			Cluster: common.String("EXAMPLE-cluster-Value"),
			CustomerTags: []cloudbridge.CustomerTag{cloudbridge.CustomerTag{Description: common.String("EXAMPLE-description-Value"),
				Name: common.String("EXAMPLE-name-Value")}},
			InstanceUuid:                   common.String("EXAMPLE-instanceUuid-Value"),
			IsDisksCbtEnabled:              common.Bool(true),
			Path:                           common.String("EXAMPLE-path-Value"),
			VmwareToolsStatus:              common.String("EXAMPLE-vmwareToolsStatus-Value"),
			CustomerFields:                 []string{"EXAMPLE--Value"},
			FaultToleranceBandwidth:        common.Int(180),
			FaultToleranceSecondaryLatency: common.Int(578),
			FaultToleranceState:            common.String("EXAMPLE-faultToleranceState-Value")},
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_GtNtx": map[string]interface{}{"EXAMPLE_KEY_qjkY6": "EXAMPLE--Value"}},
		InventoryId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-inventoryId-Value"),
		SourceKey:     common.String("EXAMPLE-sourceKey-Value"),
		Vm: &cloudbridge.VmProperties{HypervisorHost: common.String("EXAMPLE-hypervisorHost-Value"),
			HypervisorVendor:  common.String("EXAMPLE-hypervisorVendor-Value"),
			HypervisorVersion: common.String("EXAMPLE-hypervisorVersion-Value")},
		AssetSourceIds: []string{"EXAMPLE--Value"},
		Compute: &cloudbridge.ComputeProperties{IsPmemEnabled: common.Bool(false),
			NvdimmController: &cloudbridge.NvdimmController{BusNumber: common.Int(857),
				Label: common.String("EXAMPLE-label-Value")},
			DnsName:   common.String("EXAMPLE-dnsName-Value"),
			HostName:  common.String("EXAMPLE-hostName-Value"),
			NicsCount: common.Int(206),
			Nics: []cloudbridge.Nic{cloudbridge.Nic{Label: common.String("EXAMPLE-label-Value"),
				MacAddress:     common.String("EXAMPLE-macAddress-Value"),
				MacAddressType: common.String("EXAMPLE-macAddressType-Value"),
				NetworkName:    common.String("EXAMPLE-networkName-Value"),
				SwitchName:     common.String("EXAMPLE-switchName-Value"),
				IpAddresses:    []string{"EXAMPLE--Value"}}},
			OperatingSystem:     common.String("EXAMPLE-operatingSystem-Value"),
			ThreadsPerCoreCount: common.Int(409),
			GuestState:          common.String("EXAMPLE-guestState-Value"),
			HardwareVersion:     common.String("EXAMPLE-hardwareVersion-Value"),
			Nvdimms: []cloudbridge.Nvdimm{cloudbridge.Nvdimm{ControllerKey: common.Int(895),
				Label:      common.String("EXAMPLE-label-Value"),
				UnitNumber: common.Int(703)}},
			OperatingSystemVersion:  common.String("EXAMPLE-operatingSystemVersion-Value"),
			PrimaryIp:               common.String("EXAMPLE-primaryIp-Value"),
			ConnectedNetworks:       common.Int(46),
			CoresCount:              common.Int(800),
			Firmware:                common.String("EXAMPLE-firmware-Value"),
			StorageProvisionedInMBs: common.Int64(6),
			DisksCount:              common.Int(986),
			IsTpmEnabled:            common.Bool(true),
			PowerState:              common.String("EXAMPLE-powerState-Value"),
			CpuModel:                common.String("EXAMPLE-cpuModel-Value"),
			LatencySensitivity:      common.String("EXAMPLE-latencySensitivity-Value"),
			PmemInMBs:               common.Int64(793),
			Disks: []cloudbridge.Disk{cloudbridge.Disk{Uuid: common.String("EXAMPLE-uuid-Value"),
				UuidLun:        common.String("EXAMPLE-uuidLun-Value"),
				BootOrder:      common.Int(232),
				Location:       common.String("EXAMPLE-location-Value"),
				Name:           common.String("EXAMPLE-name-Value"),
				PersistentMode: common.String("EXAMPLE-persistentMode-Value"),
				SizeInMBs:      common.Int64(202)}},
			GpuDevices: []cloudbridge.GpuDevice{cloudbridge.GpuDevice{Name: common.String("EXAMPLE-name-Value"),
				CoresCount:   common.Int(32),
				Description:  common.String("EXAMPLE-description-Value"),
				Manufacturer: common.String("EXAMPLE-manufacturer-Value"),
				MemoryInMBs:  common.Int64(263)}},
			MemoryInMBs:     common.Int64(814),
			Description:     common.String("EXAMPLE-description-Value"),
			GpuDevicesCount: common.Int(357),
			ScsiController: &cloudbridge.ScsiController{Label: common.String("EXAMPLE-label-Value"),
				SharedBus:  common.String("EXAMPLE-sharedBus-Value"),
				UnitNumber: common.Int(0)}}},
		OpcRequestId:  common.String("LPUPYYIBZ58LWWOTN7ND<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

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

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