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

func ExampleCreateStack() {
	// 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 := dif.NewStackClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

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

	req := dif.CreateStackRequest{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		CreateStackDetails: dif.CreateStackDetails{Genai: []dif.GenAiDetail{dif.GenAiDetail{InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
			OciRegion:   common.String("EXAMPLE-ociRegion-Value"),
			UnitCount:   common.Int(533),
			BaseModel:   common.String("EXAMPLE-baseModel-Value"),
			ClusterType: dif.ClusterTypeHosting,
			Endpoints: []dif.EndpointDetails{dif.EndpointDetails{EndpointName: common.String("EXAMPLE-endpointName-Value"),
				IsContentModerationEnabled: common.Bool(true)}}}},
			Ggcs: []dif.GgcsDetail{dif.GgcsDetail{OggVersion: common.String("EXAMPLE-oggVersion-Value"),
				PasswordSecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value"),
				PublicSubnetId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-publicSubnetId-Value"),
				SubnetId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
				Connections: []dif.GgcsConnectionDetails{dif.GgcsConnectionDetails{ConnectionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-connectionId-Value"),
					ConnectionName: common.String("EXAMPLE-connectionName-Value"),
					DifDependencies: []dif.DifDependencyDetails{dif.DifDependencyDetails{ServiceInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value"),
						ServiceType: common.String("EXAMPLE-serviceType-Value")}},
					GgAdminSecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-ggAdminSecretId-Value")}},
				InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				Ocpu:       common.Int(975)}},
			NotificationEmail: common.String("EXAMPLE-notificationEmail-Value"),
			DisplayName:       common.String("EXAMPLE-displayName-Value"),
			Objectstorage: []dif.ObjectStorageDetail{dif.ObjectStorageDetail{AutoTiering: dif.AutoTieringDisabled,
				InstanceId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				ObjectVersioning: dif.ObjectVersioningSuspended,
				StorageTier:      dif.StorageTierStandard}},
			Services:       []dif.ServiceEnum{dif.ServiceAdb},
			StackTemplates: []dif.StackTemplateEnum{dif.StackTemplateDatapipeline},
			Adb: []dif.AdbDetail{dif.AdbDetail{ToolsPublicAccess: common.String("EXAMPLE-toolsPublicAccess-Value"),
				AdminPasswordId:          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-adminPasswordId-Value"),
				DataStorageSizeInTBs:     common.Int(607),
				DbVersion:                common.String("EXAMPLE-dbVersion-Value"),
				DbWorkload:               dif.DbWorkloadDw,
				Ecpu:                     common.Int(470),
				InstanceId:               common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				IsMtlsConnectionRequired: common.Bool(true),
				IsPublic:                 common.Bool(false),
				SubnetId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}},
			CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			Dataflow: []dif.DataflowDetail{dif.DataflowDetail{ExecutorShapeConfig: &dif.ShapeConfig{MemoryInGBs: common.Int(362),
				Ocpus: common.Int(293)},
				LogBucketInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logBucketInstanceId-Value"),
				NumExecutors:        common.Int(314),
				SparkVersion:        common.String("EXAMPLE-sparkVersion-Value"),
				Connections: &dif.DataflowConnections{ConnectionDetails: &dif.DataflowConnectionDetails{DifDependencies: []dif.DifDependencyDetails{dif.DifDependencyDetails{ServiceInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value"),
					ServiceType: common.String("EXAMPLE-serviceType-Value")}},
					DomainNames: []string{"EXAMPLE--Value"}},
					SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")},
				DriverShapeConfig: &dif.ShapeConfig{MemoryInGBs: common.Int(934),
					Ocpus: common.Int(382)},
				InstanceId:                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				PrivateEndpointId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value"),
				WarehouseBucketInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-warehouseBucketInstanceId-Value"),
				DriverShape:               common.String("EXAMPLE-driverShape-Value"),
				ExecutorShape:             common.String("EXAMPLE-executorShape-Value")}},
			DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_UpK9A": map[string]interface{}{"EXAMPLE_KEY_6gqRC": "EXAMPLE--Value"}},
			FreeformTags: map[string]string{"EXAMPLE_KEY_jUU5R": "EXAMPLE_VALUE_7SBr8jlBZ3Kf2Dk5hYcu"}},
		OpcRequestId: common.String("S7Z21QBM4CLEWWYXJ801<unique_ID>")}

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

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