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

func ExampleUpdateInfrastructure() {
	// 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 := datacc.NewBaseinfraClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

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

	req := datacc.UpdateInfrastructureRequest{OpcRequestId: common.String("NGXTKZLBA0TPVL3VGDDL<unique_ID>"),
		UpdateInfrastructureDetails: datacc.UpdateInfrastructureDetails{ClientNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond3,
			CloudControlPlaneServer2: common.String("EXAMPLE-cloudControlPlaneServer2-Value"),
			Contacts: []datacc.InfrastructureContact{datacc.InfrastructureContact{IsPrimary: common.Bool(true),
				Name:                  common.String("EXAMPLE-name-Value"),
				PhoneNumber:           common.String("EXAMPLE-phoneNumber-Value"),
				Email:                 common.String("EXAMPLE-email-Value"),
				IsContactMosValidated: common.Bool(true)}},
			Gateway: common.String("EXAMPLE-gateway-Value"),
			MaintenanceWindow: &datacc.MaintenanceWindow{DaysOfWeek: []datacc.MaintenanceWindowDaysOfWeekEnum{datacc.MaintenanceWindowDaysOfWeekFriday},
				HoursOfDay:                   []int{12},
				IsCustomActionTimeoutEnabled: common.Bool(false),
				LeadTimeInWeeks:              common.Int(1),
				PatchingMode:                 datacc.BasePatchingModeRolling,
				Preference:                   datacc.MaintenancePreferenceNoPreference,
				WeeksOfMonth:                 []int{3},
				CustomActionTimeoutInMins:    common.Int(605),
				IsMonthlyPatchingEnabled:     common.Bool(false),
				Months:                       []datacc.MaintenanceWindowMonthsEnum{datacc.MaintenanceWindowMonthsMay}},
			CloudControlPlaneServer1:      common.String("EXAMPLE-cloudControlPlaneServer1-Value"),
			CpsNetworkBondingMode:         datacc.NetworkBondingModeLacp,
			Shape:                         datacc.ShapeEnumSixSsds,
			SystemModel:                   datacc.SystemModelEnumX11Ha768,
			CpsNetworkBondingInterface:    datacc.NetworkBondingInterfaceEnumBtbond1,
			DefinedTags:                   map[string]map[string]interface{}{"EXAMPLE_KEY_tIR89": map[string]interface{}{"EXAMPLE_KEY_jn4SO": "EXAMPLE--Value"}},
			AcfsFileSystemStorageInGbs:    common.Float64(394.67572),
			BackupNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond1,
			BackupNetworkBondingMode:      datacc.NetworkBondingModeActiveBackup,
			ClientNetworkBondingMode:      datacc.NetworkBondingModeLacp,
			DnsServers:                    []string{"EXAMPLE--Value"},
			FreeformTags:                  map[string]string{"EXAMPLE_KEY_sio9c": "EXAMPLE_VALUE_592r9ySZCuw2wfW5T2ZU"},
			Description:                   common.String("EXAMPLE-description-Value"),
			DisplayName:                   common.String("EXAMPLE-displayName-Value"),
			Netmask:                       common.String("EXAMPLE-netmask-Value"),
			NtpServers:                    []string{"EXAMPLE--Value"},
			VlanId:                        common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value"),
			CorporateProxy:                common.String("EXAMPLE-corporateProxy-Value"),
			DataDiskPercentage:            common.Int(58),
			AdminNetworkcidr:              common.String("EXAMPLE-adminNetworkcidr-Value")},
		IfMatch:          common.String("EXAMPLE-ifMatch-Value"),
		InfrastructureId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-infrastructureId-Value")}

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

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