// 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 refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var scope interface{}
	scope = "EXAMPLE-scope-Value"
	req := dataintegration.CreatePipelineRequest{OpcRequestId: common.String("H30VHSGPUWXGYYVSR3ND<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		CreatePipelineDetails: dataintegration.CreatePipelineDetails{Key: common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Description: common.String("EXAMPLE-description-Value"),
				InputLinks: []dataintegration.InputLink{dataintegration.InputLink{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					FromLink:     common.String("EXAMPLE-fromLink-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(853),
					Port:         common.String("EXAMPLE-port-Value"),
					Description:  common.String("EXAMPLE-description-Value"),
					FieldMap: dataintegration.NamedEntityMap{Description: common.String("EXAMPLE-description-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(164),
						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_74HFS": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(0),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}},
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
						SourceEntity: common.String("EXAMPLE-sourceEntity-Value"),
						TargetEntity: common.String("EXAMPLE-targetEntity-Value")}}},
				Key:          common.String("EXAMPLE-key-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(764),
				Operator: dataintegration.Split{Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsInput: common.Bool(true),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")},
					DefaultValue: &defaultValue,
					Key:          common.String("EXAMPLE-key-Value"),
					ObjectStatus: common.Int(174),
					TypeName:     common.String("EXAMPLE-typeName-Value"),
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_PU96V": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(275)}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeMin,
					RootObjectDefaultValue: &rootObjectDefaultValue,
					IsOutput:               common.Bool(true),
					Type:                   &type_,
					UsedFor:                common.String("EXAMPLE-usedFor-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")},
					DataRoutingStrategy: dataintegration.SplitDataRoutingStrategyFirst,
					Description:         common.String("EXAMPLE-description-Value"),
					Identifier:          common.String("EXAMPLE-identifier-Value"),
					InputPorts: []dataintegration.InputPort{dataintegration.InputPort{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")},
						PortType:     dataintegration.InputPortPortTypeData,
						Key:          common.String("EXAMPLE-key-Value"),
						ObjectStatus: common.Int(147),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_os81M": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(88),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue}},
							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"),
						Fields: []dataintegration.TypedObject{dataintegration.Parameter{Name: common.String("EXAMPLE-name-Value"),
							ObjectStatus:          common.Int(478),
							Key:                   common.String("EXAMPLE-key-Value"),
							UsedFor:               common.String("EXAMPLE-usedFor-Value"),
							DefaultValue:          &defaultValue,
							IsOutput:              common.Bool(false),
							OutputAggregationType: dataintegration.ParameterOutputAggregationTypeSum,
							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"),
							ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
							RootObjectDefaultValue: &rootObjectDefaultValue,
							Type:                   &type_,
							TypeName:               common.String("EXAMPLE-typeName-Value"),
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_PCgRq": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
								ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
								RefValue:        &refValue,
								RootObjectValue: &rootObjectValue,
								StringValue:     common.String("EXAMPLE-stringValue-Value"),
								IntValue:        common.Int(552)}},
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
							IsInput: common.Bool(false)}},
						ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
					Name:          common.String("EXAMPLE-name-Value"),
					ObjectVersion: common.Int(153),
					OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_hYZoG": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
						StringValue:    common.String("EXAMPLE-stringValue-Value"),
						IntValue:       common.Int(431),
						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")}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(669),
					OutputPorts: []dataintegration.TypedObject{dataintegration.InputProxyField{Labels: []string{"EXAMPLE--Value"},
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(835),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						Type: dataintegration.ArrayType{Name: common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(697),
							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"),
							ElementType:  common.String("EXAMPLE-elementType-Value"),
							Key:          common.String("EXAMPLE-key-Value"),
							ModelVersion: common.String("EXAMPLE-modelVersion-Value")},
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_UZjDb": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
							StringValue:    common.String("EXAMPLE-stringValue-Value"),
							IntValue:       common.Int(883),
							ObjectValue:    &objectValue,
							ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
							RefValue:       &refValue}},
							ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
								Parent: common.String("EXAMPLE-parent-Value")}},
						Description: common.String("EXAMPLE-description-Value"),
						Key:         common.String("EXAMPLE-key-Value"),
						Scope:       &scope}}},
				OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{Description: common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(806),
					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"}}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				UiProperties: &dataintegration.UiProperties{CoordinateY: common.Float32(8410.879),
					CoordinateX: common.Float32(6298.4463)}}},
			ObjectVersion: common.Int(991),
			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"),
			Identifier:   common.String("EXAMPLE-identifier-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(863),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_p2Tdm": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(84),
				ObjectValue:     &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue}},
				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"),
				Name:                  common.String("EXAMPLE-name-Value"),
				IsInput:               common.Bool(true),
				Type:                  &type_,
				TypeName:              common.String("EXAMPLE-typeName-Value"),
				Description:           common.String("EXAMPLE-description-Value"),
				IsOutput:              common.Bool(true),
				ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				DefaultValue:           &defaultValue,
				ObjectStatus:           common.Int(932),
				RootObjectDefaultValue: &rootObjectDefaultValue}},
			RegistryMetadata: &dataintegration.RegistryMetadata{RegistryVersion: common.Int(69),
				AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:    common.Bool(false),
				Key:           common.String("EXAMPLE-key-Value"),
				Labels:        []string{"EXAMPLE--Value"}},
			Variables: []dataintegration.Variable{dataintegration.Variable{DefaultValue: &defaultValue,
				Description:   common.String("EXAMPLE-description-Value"),
				Identifier:    common.String("EXAMPLE-identifier-Value"),
				Key:           common.String("EXAMPLE-key-Value"),
				ModelType:     common.String("EXAMPLE-modelType-Value"),
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				Name:          common.String("EXAMPLE-name-Value"),
				ObjectStatus:  common.Int(551),
				ObjectVersion: common.Int(423),
				ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
					Parent: common.String("EXAMPLE-parent-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(332),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
				Type: dataintegration.CompositeType{ConfigDefinition: &dataintegration.ConfigDefinition{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(138),
					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_DkxSB": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
						DefaultValue:      &defaultValue,
						Description:       common.String("EXAMPLE-description-Value"),
						IsClassFieldValue: common.Bool(true),
						IsStatic:          common.Bool(false),
						ParameterName:     common.String("EXAMPLE-parameterName-Value")}},
					IsContained: common.Bool(true),
					Key:         common.String("EXAMPLE-key-Value")},
					Elements: []dataintegration.TypedObject{dataintegration.OutputField{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						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")},
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_0x669": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(874),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue}},
							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"),
						ObjectStatus: common.Int(712),
						Description:  common.String("EXAMPLE-description-Value"),
						Labels:       []string{"EXAMPLE--Value"}}},
					Key:          common.String("EXAMPLE-key-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					Description:  common.String("EXAMPLE-description-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(32),
					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_A6YX4": dataintegration.ConfigParameterValue{IntValue: common.Int(929),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}}}}},
			FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_P2uFe": dataintegration.ConfigParameterValue{IntValue: common.Int(435),
				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")}}}}

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