// 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 ExampleUpdateDataFlow() {
	// 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"
	var wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	req := dataintegration.UpdateDataFlowRequest{OpcRequestId: common.String("PQHSLK59MRCW6TTU6QFC<unique_ID>"),
		UpdateDataFlowDetails: dataintegration.UpdateDataFlowDetails{Description: common.String("EXAMPLE-description-Value"),
			FlowConfigValues: &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_sarrd": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(944),
					ObjectValue:    &objectValue,
					ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
					RefValue:       &refValue}}},
			Key:       common.String("EXAMPLE-key-Value"),
			ModelType: common.String("EXAMPLE-modelType-Value"),
			Name:      common.String("EXAMPLE-name-Value"),
			Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Key: common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(442),
					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")}},
				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"),
				InputLinks: []dataintegration.InputLink{dataintegration.InputLink{ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
					Parent: common.String("EXAMPLE-parent-Value")},
					Port:         common.String("EXAMPLE-port-Value"),
					Description:  common.String("EXAMPLE-description-Value"),
					FromLink:     common.String("EXAMPLE-fromLink-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					FieldMap: dataintegration.RuleBasedEntityMap{IsJavaRegexSyntax: common.Bool(false),
						Key:          common.String("EXAMPLE-key-Value"),
						MapType:      dataintegration.RuleBasedEntityMapMapTypeMapbypattern,
						ObjectStatus: common.Int(874),
						Description:  common.String("EXAMPLE-description-Value"),
						FromPattern:  common.String("EXAMPLE-fromPattern-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")},
						ToPattern: common.String("EXAMPLE-toPattern-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ye1Mx": dataintegration.ConfigParameterValue{IntValue: common.Int(768),
							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")}}},
					ObjectStatus: common.Int(960)}},
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(205),
				Operator: dataintegration.StartOperator{OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_cEP2k": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(544),
					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")}},
					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"),
					ObjectStatus:  common.Int(953),
					ObjectVersion: common.Int(436),
					OutputPorts: []dataintegration.TypedObject{dataintegration.DecisionOutputPort{Key: common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(259),
						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_F7YV1": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(759),
							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")}},
						Name:                   common.String("EXAMPLE-name-Value"),
						PortType:               dataintegration.DecisionOutputPortPortTypeData,
						DecisionOutputPortType: dataintegration.DecisionOutputPortDecisionOutputPortTypeFalse,
						Description:            common.String("EXAMPLE-description-Value")}},
					Parameters: []dataintegration.Parameter{dataintegration.Parameter{DefaultValue: &defaultValue,
						IsOutput:              common.Bool(false),
						Name:                  common.String("EXAMPLE-name-Value"),
						OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
						Type:                  &type_,
						TypeName:              common.String("EXAMPLE-typeName-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Nb0ZF": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(294)}},
							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"),
						ObjectStatus: common.Int(314),
						IsInput:      common.Bool(true),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						RootObjectDefaultValue: &rootObjectDefaultValue,
						Key:                    common.String("EXAMPLE-key-Value"),
						UsedFor:                common.String("EXAMPLE-usedFor-Value")}},
					Description: common.String("EXAMPLE-description-Value"),
					InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Key: common.String("EXAMPLE-key-Value"),
						ObjectStatus: common.Int(491),
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")},
						PortType: dataintegration.InputPortPortTypeControl,
						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_s82R4": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
								StringValue:    common.String("EXAMPLE-stringValue-Value"),
								IntValue:       common.Int(103),
								ObjectValue:    &objectValue,
								ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
								RefValue:       &refValue}}},
						Description:  common.String("EXAMPLE-description-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						Fields: []dataintegration.TypedObject{dataintegration.MacroField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_kCYOg": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(481),
							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")}},
							Description: common.String("EXAMPLE-description-Value"),
							Expr: &dataintegration.Expression{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_W1teA": dataintegration.ConfigParameterValue{IntValue: common.Int(392),
								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"),
								Key:          common.String("EXAMPLE-key-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								ObjectStatus: common.Int(813),
								ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
									Parent: common.String("EXAMPLE-parent-Value")}},
							IsUseSourceType: common.Bool(true),
							Key:             common.String("EXAMPLE-key-Value"),
							Labels:          []string{"EXAMPLE--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")},
							Name:         common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(79),
							Type: dataintegration.ArrayType{Key: common.String("EXAMPLE-key-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								Name:         common.String("EXAMPLE-name-Value"),
								ObjectStatus: common.Int(792),
								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")},
							UseType: &dataintegration.ConfiguredType{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_pWArM": dataintegration.ConfigParameterValue{IntValue: common.Int(196),
								ObjectValue:     &objectValue,
								ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
								RefValue:        &refValue,
								RootObjectValue: &rootObjectValue,
								StringValue:     common.String("EXAMPLE-stringValue-Value")}},
								ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
									Parent: common.String("EXAMPLE-parent-Value")}},
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								Name:         common.String("EXAMPLE-name-Value"),
								ObjectStatus: common.Int(24),
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
								ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_AzgP1": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
									DefaultValue:      &defaultValue,
									Description:       common.String("EXAMPLE-description-Value"),
									IsClassFieldValue: common.Bool(false),
									IsStatic:          common.Bool(false),
									ParameterName:     common.String("EXAMPLE-parameterName-Value"),
									ParameterType: dataintegration.ArrayType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
										Name:         common.String("EXAMPLE-name-Value"),
										ObjectStatus: common.Int(904),
										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"),
										ElementType: common.String("EXAMPLE-elementType-Value"),
										Key:         common.String("EXAMPLE-key-Value")}}},
									IsContained:  common.Bool(true),
									Key:          common.String("EXAMPLE-key-Value"),
									ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
									Name:         common.String("EXAMPLE-name-Value"),
									ObjectStatus: common.Int(906),
									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"),
								WrappedType: &wrappedType}}}}},
					Key: common.String("EXAMPLE-key-Value")},
				UiProperties: &dataintegration.UiProperties{CoordinateX: common.Float32(6019.2437),
					CoordinateY: common.Float32(3120.7632)}}},
			ObjectVersion: common.Int(134),
			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"),
			ObjectStatus: common.Int(607),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsInput: common.Bool(true),
				IsOutput:               common.Bool(true),
				Key:                    common.String("EXAMPLE-key-Value"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				Type:                   &type_,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_DoNqV": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(354),
					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")}},
				ObjectStatus:          common.Int(790),
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
				DefaultValue:          &defaultValue,
				Name:                  common.String("EXAMPLE-name-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")},
				TypeName:    common.String("EXAMPLE-typeName-Value"),
				Description: common.String("EXAMPLE-description-Value")}},
			RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(false),
				Key:             common.String("EXAMPLE-key-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(8)}},
		WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		DataFlowKey: common.String("EXAMPLE-dataFlowKey-Value"),
		IfMatch:     common.String("EXAMPLE-ifMatch-Value")}

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

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