// 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 ExampleDeployArtifacts() {
	// 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.DeployArtifactsRequest{DeployArtifactsDetails: dif.DeployArtifactsDetails{Dataflow: []dif.DataflowArtifactsDetail{dif.DataflowArtifactsDetail{ArchiveUri: common.String("EXAMPLE-archiveUri-Value"),
		Execute:    common.String("EXAMPLE-execute-Value"),
		InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
		Ggcs: []dif.GgcsArtifactsDetail{dif.GgcsArtifactsDetail{ArtifactObjectStoragePath: common.String("EXAMPLE-artifactObjectStoragePath-Value"),
			InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
			Sources: []dif.GgcsSourceDetail{dif.GgcsSourceDetail{TargetUri: common.String("EXAMPLE-targetUri-Value"),
				Action:                      dif.WorkflowActionCreate,
				ShouldStartSourceOperations: common.Bool(true),
				SourceId:                    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceId-Value"),
				TargetConnectionName:        common.String("EXAMPLE-targetConnectionName-Value")}},
			Targets: []dif.GgcsTargetDetail{dif.GgcsTargetDetail{SourceUri: common.String("EXAMPLE-sourceUri-Value"),
				TargetId:                    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-targetId-Value"),
				Action:                      dif.WorkflowActionCreate,
				ShouldStartTargetOperations: common.Bool(false),
				SourceConnectionName:        common.String("EXAMPLE-sourceConnectionName-Value")}},
			Users: []dif.GgcsUserDetail{dif.GgcsUserDetail{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
				UserName: common.String("EXAMPLE-userName-Value"),
				UserType: common.String("EXAMPLE-userType-Value"),
				Action:   dif.WorkflowActionUpdate}}}},
		Oke: []dif.OkeArtifactsDetail{dif.OkeArtifactsDetail{ManifestObjectStoragePath: common.String("EXAMPLE-manifestObjectStoragePath-Value"),
			Secrets: []dif.SecretDetail{dif.SecretDetail{SecretData: []dif.SecretData{dif.SecretData{Key: common.String("EXAMPLE-key-Value"),
				SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")}},
				SecretName:                common.String("EXAMPLE-secretName-Value"),
				TemplateObjectStoragePath: common.String("EXAMPLE-templateObjectStoragePath-Value")}},
			ComponentValueOverrides: []dif.ComponentValueOverride{dif.ComponentValueOverride{ComponentName: common.String("EXAMPLE-componentName-Value"),
				ValueOverrides: map[string]string{"EXAMPLE_KEY_HA3tA": "EXAMPLE_VALUE_Snq6C6PKt3qEUX9aTbag"}}},
			InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
		Omk: []dif.OmkArtifactsDetail{dif.OmkArtifactsDetail{ComponentValueOverrides: []dif.ComponentValueOverride{dif.ComponentValueOverride{ComponentName: common.String("EXAMPLE-componentName-Value"),
			ValueOverrides: map[string]string{"EXAMPLE_KEY_MLOCs": "EXAMPLE_VALUE_N5aaPtV3AWATEI2kePCK"}}},
			InstanceId:                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
			ManifestObjectStoragePath: common.String("EXAMPLE-manifestObjectStoragePath-Value"),
			Secrets: []dif.SecretDetail{dif.SecretDetail{SecretData: []dif.SecretData{dif.SecretData{Key: common.String("EXAMPLE-key-Value"),
				SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")}},
				SecretName:                common.String("EXAMPLE-secretName-Value"),
				TemplateObjectStoragePath: common.String("EXAMPLE-templateObjectStoragePath-Value")}}}},
		Services:       []dif.ServiceEnum{dif.ServiceGgcs},
		StackTemplates: []dif.StackTemplateEnum{dif.StackTemplateDevopstoolkit},
		SubnetId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
		Adb: []dif.AdbArtifactsDetail{dif.AdbArtifactsDetail{ArtifactObjectStoragePath: common.String("EXAMPLE-artifactObjectStoragePath-Value"),
			DbCredentials: []dif.DbCredentialsDetail{dif.DbCredentialsDetail{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
				UserName: common.String("EXAMPLE-userName-Value"),
				UserType: common.String("EXAMPLE-userType-Value")}},
			InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}}},
		IfMatch:       common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId:  common.String("TDJDPS4M9S2TZS1CIZ2U<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		StackId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-stackId-Value")}

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

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