// 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 ExampleCreateInfrastructure() {
	// 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.CreateInfrastructureRequest{CreateInfrastructureDetails: datacc.CreateInfrastructureDetails{AcfsFileSystemStorageInGbs: common.Float64(5230.857),
		BackupNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond3,
		CpsNetworkBondingMode:         datacc.NetworkBondingModeActiveBackup,
		DataDiskPercentage:            common.Int(48),
		Description:                   common.String("EXAMPLE-description-Value"),
		DnsServers:                    []string{"EXAMPLE--Value"},
		Netmask:                       common.String("EXAMPLE-netmask-Value"),
		CloudControlPlaneServer1:      common.String("EXAMPLE-cloudControlPlaneServer1-Value"),
		CloudControlPlaneServer2:      common.String("EXAMPLE-cloudControlPlaneServer2-Value"),
		DefinedTags:                   map[string]map[string]interface{}{"EXAMPLE_KEY_T3QO0": map[string]interface{}{"EXAMPLE_KEY_iscrk": "EXAMPLE--Value"}},
		MaintenanceWindow: &datacc.MaintenanceWindow{CustomActionTimeoutInMins: common.Int(642),
			HoursOfDay:                   []int{0},
			IsCustomActionTimeoutEnabled: common.Bool(true),
			IsMonthlyPatchingEnabled:     common.Bool(true),
			WeeksOfMonth:                 []int{1},
			DaysOfWeek:                   []datacc.MaintenanceWindowDaysOfWeekEnum{datacc.MaintenanceWindowDaysOfWeekSaturday},
			LeadTimeInWeeks:              common.Int(1),
			Months:                       []datacc.MaintenanceWindowMonthsEnum{datacc.MaintenanceWindowMonthsNovember},
			PatchingMode:                 datacc.BasePatchingModeRolling,
			Preference:                   datacc.MaintenancePreferenceNoPreference},
		ClientNetworkBondingMode:      datacc.NetworkBondingModeActiveBackup,
		CorporateProxy:                common.String("EXAMPLE-corporateProxy-Value"),
		CpsNetworkBondingInterface:    datacc.NetworkBondingInterfaceEnumBtbond5,
		DisplayName:                   common.String("EXAMPLE-displayName-Value"),
		Gateway:                       common.String("EXAMPLE-gateway-Value"),
		Shape:                         datacc.ShapeEnumTwentyFourSsds,
		SystemModel:                   datacc.SystemModelEnumX11Ha768,
		AdminNetworkcidr:              common.String("EXAMPLE-adminNetworkcidr-Value"),
		BackupNetworkBondingMode:      datacc.NetworkBondingModeActiveBackup,
		ClientNetworkBondingInterface: datacc.NetworkBondingInterfaceEnumBtbond4,
		CompartmentId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		Contacts: []datacc.InfrastructureContact{datacc.InfrastructureContact{Email: common.String("EXAMPLE-email-Value"),
			IsContactMosValidated: common.Bool(true),
			IsPrimary:             common.Bool(false),
			Name:                  common.String("EXAMPLE-name-Value"),
			PhoneNumber:           common.String("EXAMPLE-phoneNumber-Value")}},
		FreeformTags: map[string]string{"EXAMPLE_KEY_fQueK": "EXAMPLE_VALUE_IfFGLzmzip14BajwlbOr"},
		NtpServers:   []string{"EXAMPLE--Value"},
		VlanId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value")},
		OpcRequestId:  common.String("ZSZFHJQBGMYB6YXOPZU1<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

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

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