// 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{OpcRequestId: common.String("CKHA3TASNQ6C6PKT3QEU<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		CreateStackDetails: dif.CreateStackDetails{Ggcs: []dif.GgcsDetail{dif.GgcsDetail{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(377),
			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")}},
			Objectstorage: []dif.ObjectStorageDetail{dif.ObjectStorageDetail{AutoTiering: dif.AutoTieringInfrequentaccess,
				InstanceId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				ObjectVersioning: dif.ObjectVersioningEnabled,
				StorageTier:      dif.StorageTierArchive}},
			Adb: []dif.AdbDetail{dif.AdbDetail{InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				IsPublic:                 common.Bool(true),
				AdminPasswordId:          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-adminPasswordId-Value"),
				DbVersion:                common.String("EXAMPLE-dbVersion-Value"),
				DbWorkload:               dif.DbWorkloadDw,
				Ecpu:                     common.Int(121),
				IsMtlsConnectionRequired: common.Bool(false),
				SubnetId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
				ToolsPublicAccess:        common.String("EXAMPLE-toolsPublicAccess-Value"),
				DataStorageSizeInTBs:     common.Int(942)}},
			CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			DisplayName:   common.String("EXAMPLE-displayName-Value"),
			Services:      []dif.ServiceEnum{dif.ServiceOke},
			Aidataplatform: []dif.AiDataPlatformDetail{dif.AiDataPlatformDetail{DefaultWorkspaceName: common.String("EXAMPLE-defaultWorkspaceName-Value"),
				InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
			Oke: []dif.OkeDetail{dif.OkeDetail{NamespaceName: common.String("EXAMPLE-namespaceName-Value"),
				ClusterId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value"),
				InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
			Omk: []dif.OmkDetail{dif.OmkDetail{ClusterId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value"),
				ClusterNamespaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterNamespaceId-Value"),
				InstanceId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				NamespaceName:      common.String("EXAMPLE-namespaceName-Value")}},
			FreeformTags: map[string]string{"EXAMPLE_KEY_yhbF2": "EXAMPLE_VALUE_kxK2AypMLOCsN5aaPtV3"},
			Genai: []dif.GenAiDetail{dif.GenAiDetail{BaseModel: common.String("EXAMPLE-baseModel-Value"),
				ClusterType: dif.ClusterTypeHosting,
				Endpoints: []dif.EndpointDetails{dif.EndpointDetails{EndpointName: common.String("EXAMPLE-endpointName-Value"),
					IsContentModerationEnabled: common.Bool(true)}},
				InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				OciRegion:  common.String("EXAMPLE-ociRegion-Value"),
				UnitCount:  common.Int(418)}},
			NotificationEmail: common.String("EXAMPLE-notificationEmail-Value"),
			StackTemplates:    []dif.StackTemplateEnum{dif.StackTemplateAiservices},
			Dataflow: []dif.DataflowDetail{dif.DataflowDetail{ExecutorShapeConfig: &dif.ShapeConfig{MemoryInGBs: common.Int(379),
				Ocpus: common.Int(861)},
				InstanceId:                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
				LogBucketInstanceId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-logBucketInstanceId-Value"),
				PrivateEndpointId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value"),
				SparkVersion:              common.String("EXAMPLE-sparkVersion-Value"),
				WarehouseBucketInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-warehouseBucketInstanceId-Value"),
				Connections: &dif.DataflowConnections{ConnectionDetails: &dif.DataflowConnectionDetails{DomainNames: []string{"EXAMPLE--Value"},
					DifDependencies: []dif.DifDependencyDetails{dif.DifDependencyDetails{ServiceInstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value"),
						ServiceType: common.String("EXAMPLE-serviceType-Value")}}},
					SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")},
				DriverShape:  common.String("EXAMPLE-driverShape-Value"),
				NumExecutors: common.Int(958),
				DriverShapeConfig: &dif.ShapeConfig{Ocpus: common.Int(419),
					MemoryInGBs: common.Int(558)},
				ExecutorShape: common.String("EXAMPLE-executorShape-Value")}},
			DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_I2keP": map[string]interface{}{"EXAMPLE_KEY_AWATE": "EXAMPLE--Value"}}}}

	// 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)
}