// 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 rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	req := dataintegration.CreatePipelineRequest{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		CreatePipelineDetails: dataintegration.CreatePipelineDetails{ObjectVersion: common.Int(694),
			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"),
			ModelType:   common.String("EXAMPLE-modelType-Value"),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{Key: common.String("EXAMPLE-key-Value"),
				IsInput:                common.Bool(true),
				IsOutput:               common.Bool(true),
				ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus:           common.Int(939),
				OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeSum,
				Name:                   common.String("EXAMPLE-name-Value"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				UsedFor:                common.String("EXAMPLE-usedFor-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_DiLln": dataintegration.ConfigParameterValue{IntValue: common.Int(186),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-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")},
				Type:         &type_,
				TypeName:     common.String("EXAMPLE-typeName-Value"),
				DefaultValue: &defaultValue}},
			RegistryMetadata: &dataintegration.RegistryMetadata{Key: common.String("EXAMPLE-key-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(277),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(true)},
			Variables: []dataintegration.Variable{dataintegration.Variable{Description: common.String("EXAMPLE-description-Value"),
				Identifier: common.String("EXAMPLE-identifier-Value"),
				Key:        common.String("EXAMPLE-key-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")},
				DefaultValue:  &defaultValue,
				ModelType:     common.String("EXAMPLE-modelType-Value"),
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus:  common.Int(601),
				ObjectVersion: common.Int(326),
				RootObjectDefaultValue: &dataintegration.RootObject{ModelType: common.String("EXAMPLE-modelType-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(882),
					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")},
				Type: dataintegration.MapType{ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
					ContainsNull:   common.Bool(true),
					Description:    common.String("EXAMPLE-description-Value"),
					Key:            common.String("EXAMPLE-key-Value"),
					ModelVersion:   common.String("EXAMPLE-modelVersion-Value"),
					Name:           common.String("EXAMPLE-name-Value"),
					KeyElementType: common.String("EXAMPLE-keyElementType-Value"),
					ObjectStatus:   common.Int(275),
					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_VqHqo": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(916),
					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")}}}},
			FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_gKwCj": dataintegration.ConfigParameterValue{IntValue: common.Int(639),
				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")}},
			Identifier:   common.String("EXAMPLE-identifier-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Description: common.String("EXAMPLE-description-Value"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(290),
				Operator: dataintegration.DecisionOperator{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:          common.String("EXAMPLE-name-Value"),
					ObjectStatus:  common.Int(491),
					ObjectVersion: common.Int(792),
					Parameters: []dataintegration.Parameter{dataintegration.Parameter{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						RootObjectDefaultValue: &rootObjectDefaultValue,
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_S4EJo": dataintegration.ConfigParameterValue{IntValue: common.Int(477),
							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")}},
						IsInput:               common.Bool(false),
						TypeName:              common.String("EXAMPLE-typeName-Value"),
						UsedFor:               common.String("EXAMPLE-usedFor-Value"),
						Description:           common.String("EXAMPLE-description-Value"),
						Key:                   common.String("EXAMPLE-key-Value"),
						ObjectStatus:          common.Int(342),
						Type:                  &type_,
						DefaultValue:          &defaultValue,
						IsOutput:              common.Bool(true),
						Name:                  common.String("EXAMPLE-name-Value"),
						OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
						ModelVersion:          common.String("EXAMPLE-modelVersion-Value")}},
					Description: common.String("EXAMPLE-description-Value"),
					Key:         common.String("EXAMPLE-key-Value"),
					OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_XYcmU": dataintegration.ConfigParameterValue{IntValue: common.Int(235),
						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")}},
					OutputPorts: []dataintegration.TypedObject{dataintegration.InputPort{ObjectStatus: common.Int(306),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						PortType:     dataintegration.InputPortPortTypeControl,
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_MWCqN": dataintegration.ConfigParameterValue{IntValue: common.Int(614),
							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")}},
						Description: common.String("EXAMPLE-description-Value"),
						Key:         common.String("EXAMPLE-key-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")},
					TriggerRule: dataintegration.DecisionOperatorTriggerRuleSuccess,
					Identifier:  common.String("EXAMPLE-identifier-Value"),
					InputPorts: []dataintegration.InputPort{dataintegration.InputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_1f41M": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
						StringValue:    common.String("EXAMPLE-stringValue-Value"),
						IntValue:       common.Int(994),
						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")}},
						Fields: []dataintegration.TypedObject{dataintegration.ShapeField{Description: common.String("EXAMPLE-description-Value"),
							Key:          common.String("EXAMPLE-key-Value"),
							Labels:       []string{"EXAMPLE--Value"},
							ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							Name:         common.String("EXAMPLE-name-Value"),
							NativeShapeField: &dataintegration.NativeShapeField{IsMandatory: common.Bool(false),
								Name:     common.String("EXAMPLE-name-Value"),
								Position: common.Int(331),
								Type:     &type_,
								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_pS8nQ": dataintegration.ConfigParameterValue{IntValue: common.Int(536),
										ObjectValue:     &objectValue,
										ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
										RefValue:        &refValue,
										RootObjectValue: &rootObjectValue,
										StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
								DefaultValueString: common.String("EXAMPLE-defaultValueString-Value")},
							Type: &type_,
							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_AQT6E": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
									RefValue:        &refValue,
									RootObjectValue: &rootObjectValue,
									StringValue:     common.String("EXAMPLE-stringValue-Value"),
									IntValue:        common.Int(381),
									ObjectValue:     &objectValue}}},
							ObjectStatus: common.Int(846),
							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"),
						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"),
						ObjectStatus: common.Int(510),
						PortType:     dataintegration.InputPortPortTypeControl}}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				InputLinks: []dataintegration.InputLink{dataintegration.InputLink{Description: common.String("EXAMPLE-description-Value"),
					ObjectStatus: common.Int(580),
					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"),
					FieldMap: dataintegration.DirectFieldMap{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_pcxYX": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(709),
						ObjectValue:     &objectValue}},
						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(186),
						SourceTypedObject: common.String("EXAMPLE-sourceTypedObject-Value"),
						TargetScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
							ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
							ReferenceType:   dataintegration.ScopeReferenceReferenceTypeOciFunctionInputShape},
						Description:  common.String("EXAMPLE-description-Value"),
						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")},
						SourceScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
							ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
							ReferenceType:   dataintegration.ScopeReferenceReferenceTypeOciFunctionInputShape},
						TargetTypedObject: common.String("EXAMPLE-targetTypedObject-Value")},
					FromLink:     common.String("EXAMPLE-fromLink-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"),
				OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(811),
					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"),
					Key:         common.String("EXAMPLE-key-Value")}},
				UiProperties: &dataintegration.UiProperties{CoordinateX: common.Float32(2075.6208),
					CoordinateY: common.Float32(954.72217)}}},
			ObjectStatus: common.Int(380)},
		OpcRequestId: common.String("GP5WJXOVPVQKOCTAJBT1<unique_ID>")}

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