// 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 ExampleUpdatePipeline() {
	// 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 objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	req := dataintegration.UpdatePipelineRequest{WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		IfMatch:      common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("JSRAPLPRLSJYRZEBBTYN<unique_ID>"),
		PipelineKey:  common.String("EXAMPLE-pipelineKey-Value"),
		UpdatePipelineDetails: dataintegration.UpdatePipelineDetails{Name: common.String("EXAMPLE-name-Value"),
			Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Key: common.String("EXAMPLE-key-Value"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{ObjectStatus: common.Int(194),
					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"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
				InputLinks: []dataintegration.InputLink{dataintegration.InputLink{FieldMap: dataintegration.DirectFieldMap{Key: common.String("EXAMPLE-key-Value"),
					ObjectStatus: common.Int(278),
					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"),
					TargetTypedObject: common.String("EXAMPLE-targetTypedObject-Value"),
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_5dGuN": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(971)}},
						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"),
					SourceScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
						ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
						ReferenceType:   dataintegration.ScopeReferenceReferenceTypeDirectRef},
					TargetScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
						ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
						ReferenceType:   dataintegration.ScopeReferenceReferenceTypeOciFunctionOutputShape}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(949),
					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"),
					FromLink:    common.String("EXAMPLE-fromLink-Value"),
					Port:        common.String("EXAMPLE-port-Value")}},
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(499),
				Operator: dataintegration.Projection{InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Fields: []dataintegration.TypedObject{dataintegration.OutputPort{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.OutputPortPortTypeModel,
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(427),
					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_Y4VVh": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(474),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue}}},
					Description: common.String("EXAMPLE-description-Value"),
					Key:         common.String("EXAMPLE-key-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")},
					PortType:     dataintegration.InputPortPortTypeControl,
					Description:  common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ObjectStatus: common.Int(434),
					ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")},
						ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_bm8fs": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
							StringValue:    common.String("EXAMPLE-stringValue-Value"),
							IntValue:       common.Int(261),
							ObjectValue:    &objectValue,
							ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
							RefValue:       &refValue}}}}},
					Key:           common.String("EXAMPLE-key-Value"),
					ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
					Name:          common.String("EXAMPLE-name-Value"),
					ObjectStatus:  common.Int(156),
					ObjectVersion: common.Int(244),
					Parameters: []dataintegration.Parameter{dataintegration.Parameter{DefaultValue: &defaultValue,
						Description: common.String("EXAMPLE-description-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,
						Type:                   &type_,
						IsInput:                common.Bool(false),
						IsOutput:               common.Bool(false),
						TypeName:               common.String("EXAMPLE-typeName-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_l9ey8": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(991),
							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")}},
						ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
						OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
						UsedFor:               common.String("EXAMPLE-usedFor-Value"),
						Name:                  common.String("EXAMPLE-name-Value"),
						ObjectStatus:          common.Int(676)}},
					Description: common.String("EXAMPLE-description-Value"),
					Identifier:  common.String("EXAMPLE-identifier-Value"),
					OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Jj1Wh": dataintegration.ConfigParameterValue{IntValue: common.Int(563),
						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.DecisionOutputPort{ObjectStatus: common.Int(739),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						PortType: dataintegration.DecisionOutputPortPortTypeControl,
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_RXUY0": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(336),
							ObjectValue:     &objectValue}},
							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"),
						Name:                   common.String("EXAMPLE-name-Value"),
						DecisionOutputPortType: dataintegration.DecisionOutputPortDecisionOutputPortTypeFalse,
						Key:                    common.String("EXAMPLE-key-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")}},
				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(2338.9363),
					CoordinateY: common.Float32(2793.9873)},
				Description: common.String("EXAMPLE-description-Value")}},
			RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(true),
				Key:             common.String("EXAMPLE-key-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(934)},
			Variables: []dataintegration.Variable{dataintegration.Variable{RootObjectDefaultValue: &dataintegration.RootObject{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"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(31)},
				Type: dataintegration.MapType{ContainsNull: common.Bool(false),
					KeyElementType: common.String("EXAMPLE-keyElementType-Value"),
					Name:           common.String("EXAMPLE-name-Value"),
					ObjectStatus:   common.Int(754),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
					Description:      common.String("EXAMPLE-description-Value"),
					Key:              common.String("EXAMPLE-key-Value"),
					ModelVersion:     common.String("EXAMPLE-modelVersion-Value")},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_nUiOy": dataintegration.ConfigParameterValue{RefValue: &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(335),
					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")}},
				Description:   common.String("EXAMPLE-description-Value"),
				Identifier:    common.String("EXAMPLE-identifier-Value"),
				ModelType:     common.String("EXAMPLE-modelType-Value"),
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				Name:          common.String("EXAMPLE-name-Value"),
				ObjectVersion: common.Int(340),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				DefaultValue: &defaultValue,
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(607)}},
			Description: common.String("EXAMPLE-description-Value"),
			FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ReLfa": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(516)}},
				ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
					Parent: common.String("EXAMPLE-parent-Value")}},
			Key:           common.String("EXAMPLE-key-Value"),
			ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus:  common.Int(380),
			ObjectVersion: common.Int(924),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
				Name:                   common.String("EXAMPLE-name-Value"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_GqcSz": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(502),
					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")}},
				DefaultValue: &defaultValue,
				Key:          common.String("EXAMPLE-key-Value"),
				Type:         &type_,
				TypeName:     common.String("EXAMPLE-typeName-Value"),
				Description:  common.String("EXAMPLE-description-Value"),
				IsOutput:     common.Bool(true),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				IsInput:      common.Bool(false),
				ObjectStatus: common.Int(92)}},
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")},
			Identifier: common.String("EXAMPLE-identifier-Value"),
			ModelType:  common.String("EXAMPLE-modelType-Value")}}

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

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