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

func ExampleCreatePipeline() {
	// 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 := dataintegration.NewDataIntegrationClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	req := dataintegration.CreatePipelineRequest{CreatePipelineDetails: dataintegration.CreatePipelineDetails{Name: common.String("EXAMPLE-name-Value"),
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		RegistryMetadata: &dataintegration.RegistryMetadata{IsFavorite: common.Bool(false),
			Key:             common.String("EXAMPLE-key-Value"),
			Labels:          []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(69),
			AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value")},
		Variables: []dataintegration.Variable{dataintegration.Variable{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:          common.String("EXAMPLE-name-Value"),
			ObjectStatus:  common.Int(533),
			ObjectVersion: common.Int(370),
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_hVzlt": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
				StringValue:    common.String("EXAMPLE-stringValue-Value"),
				IntValue:       common.Int(701),
				ObjectValue:    &objectValue,
				ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
				RefValue:       &refValue}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			Description: common.String("EXAMPLE-description-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			RootObjectDefaultValue: &dataintegration.RootObject{Key: common.String("EXAMPLE-key-Value"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(671),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			Type: dataintegration.JavaType{ConfigDefinition: &dataintegration.ConfigDefinition{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(11),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_BZDjn": dataintegration.ConfigParameterDefinition{ParameterName: common.String("EXAMPLE-parameterName-Value"),
					ClassFieldName:    common.String("EXAMPLE-classFieldName-Value"),
					DefaultValue:      &defaultValue,
					Description:       common.String("EXAMPLE-description-Value"),
					IsClassFieldValue: common.Bool(true),
					IsStatic:          common.Bool(false)}},
				IsContained: common.Bool(false),
				Key:         common.String("EXAMPLE-key-Value")},
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(759),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Description:  common.String("EXAMPLE-description-Value"),
				JavaTypeName: common.String("EXAMPLE-javaTypeName-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value")},
			DefaultValue: &defaultValue,
			Identifier:   common.String("EXAMPLE-identifier-Value"),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value")}},
		Description: common.String("EXAMPLE-description-Value"),
		Identifier:  common.String("EXAMPLE-identifier-Value"),
		Key:         common.String("EXAMPLE-key-Value"),
		ModelType:   common.String("EXAMPLE-modelType-Value"),
		Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Key: common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(939),
			Operator: dataintegration.Joiner{Description: common.String("EXAMPLE-description-Value"),
				InputPorts: []dataintegration.InputPort{dataintegration.InputPort{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					PortType: dataintegration.InputPortPortTypeModel,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_fVZ9H": dataintegration.ConfigParameterValue{IntValue: common.Int(90),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					Fields: []dataintegration.TypedObject{dataintegration.FlowPort{Name: common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(934),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_yiw0M": dataintegration.ConfigParameterValue{IntValue: common.Int(290),
								ObjectValue:     &objectValue,
								ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
								RefValue:        &refValue,
								RootObjectValue: &rootObjectValue,
								StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
						Description:  common.String("EXAMPLE-description-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
					Key:          common.String("EXAMPLE-key-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(829),
					Description:  common.String("EXAMPLE-description-Value")}},
				OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_tAKOy": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(211),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue}},
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")}},
				Parameters: []dataintegration.Parameter{dataintegration.Parameter{DefaultValue: &defaultValue,
					Type: &type_,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_yBheg": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(450)}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					Description:           common.String("EXAMPLE-description-Value"),
					IsOutput:              common.Bool(false),
					ObjectStatus:          common.Int(44),
					OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
					IsInput:               common.Bool(false),
					ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					TypeName:               common.String("EXAMPLE-typeName-Value"),
					UsedFor:                common.String("EXAMPLE-usedFor-Value"),
					Key:                    common.String("EXAMPLE-key-Value"),
					Name:                   common.String("EXAMPLE-name-Value"),
					RootObjectDefaultValue: &rootObjectDefaultValue}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Identifier:    common.String("EXAMPLE-identifier-Value"),
				ObjectVersion: common.Int(258),
				OutputPorts: []dataintegration.TypedObject{dataintegration.DecisionOutputPort{DecisionOutputPortType: dataintegration.DecisionOutputPortDecisionOutputPortTypeFalse,
					Name: common.String("EXAMPLE-name-Value"),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					Description:  common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(622),
					PortType:     dataintegration.DecisionOutputPortPortTypeData,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_5ECHh": dataintegration.ConfigParameterValue{RefValue: &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(453),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}},
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")}}}},
				JoinType:     dataintegration.JoinerJoinTypeInner,
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				JoinCondition: &dataintegration.Expression{Key: common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(94),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_B7mXZ": dataintegration.ConfigParameterValue{IntValue: common.Int(273),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					ExprString: common.String("EXAMPLE-exprString-Value")},
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(529)},
			OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{Key: common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(968),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Port:        common.String("EXAMPLE-port-Value"),
				ToLinks:     []string{"EXAMPLE--Value"},
				Description: common.String("EXAMPLE-description-Value")}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			UiProperties: &dataintegration.UiProperties{CoordinateX: common.Float32(3678.2634),
				CoordinateY: common.Float32(995.512)},
			Description: common.String("EXAMPLE-description-Value"),
			InputLinks: []dataintegration.InputLink{dataintegration.InputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				FieldMap: dataintegration.DirectFieldMap{SourceScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
					ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
					ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShapeField},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_frXc1": dataintegration.ConfigParameterValue{IntValue: common.Int(569),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(7),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					SourceTypedObject: common.String("EXAMPLE-sourceTypedObject-Value"),
					TargetScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
						ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
						ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShape},
					TargetTypedObject: common.String("EXAMPLE-targetTypedObject-Value"),
					Description:       common.String("EXAMPLE-description-Value")},
				FromLink:     common.String("EXAMPLE-fromLink-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(572),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Port:        common.String("EXAMPLE-port-Value"),
				Description: common.String("EXAMPLE-description-Value")}},
			ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
		ObjectStatus:  common.Int(620),
		ObjectVersion: common.Int(145),
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{DefaultValue: &defaultValue,
			Description:           common.String("EXAMPLE-description-Value"),
			IsInput:               common.Bool(true),
			ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
			Name:                  common.String("EXAMPLE-name-Value"),
			OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_W4XsK": dataintegration.ConfigParameterValue{IntValue: common.Int(332),
				ObjectValue:     &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value")}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			IsOutput:     common.Bool(true),
			ObjectStatus: common.Int(703),
			Type:         &type_,
			TypeName:     common.String("EXAMPLE-typeName-Value"),
			Key:          common.String("EXAMPLE-key-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			RootObjectDefaultValue: &rootObjectDefaultValue,
			UsedFor:                common.String("EXAMPLE-usedFor-Value")}},
		FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_8gcbw": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(717),
			ObjectValue:     &objectValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
		ModelVersion: common.String("EXAMPLE-modelVersion-Value")},
		OpcRequestId:  common.String("R2LEIPR5FLICYTUML1RF<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")}

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

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