// 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 ExampleCreateDataFlow() {
	// 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 scope interface{}
	scope = "EXAMPLE-scope-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	req := dataintegration.CreateDataFlowRequest{OpcRequestId: common.String("KPRFDEDOEIT9HNVG3EOK<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		CreateDataFlowDetails: dataintegration.CreateDataFlowDetails{Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Description: common.String("EXAMPLE-description-Value"),
			InputLinks: []dataintegration.InputLink{dataintegration.InputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Description: common.String("EXAMPLE-description-Value"),
				FieldMap: dataintegration.RuleBasedFieldMap{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_GoTPl": dataintegration.ConfigParameterValue{IntValue: common.Int(396),
					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")}},
					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")},
					ToRuleConfig: &dataintegration.RuleTypeConfig{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_s3KJt": dataintegration.ConfigParameterValue{IntValue: common.Int(866),
						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(867),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						IsOrderByRule: common.Bool(true),
						Key:           common.String("EXAMPLE-key-Value"),
						ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
						ProjectionRules: []dataintegration.ProjectionRule{dataintegration.TypeListRule{Description: common.String("EXAMPLE-description-Value"),
							MatchingStrategy:            dataintegration.TypeListRuleMatchingStrategyNameOnly,
							ModelVersion:                common.String("EXAMPLE-modelVersion-Value"),
							Types:                       []interface{}{"EXAMPLE-types-Value"},
							IsCascade:                   common.Bool(false),
							IsJavaRegexSyntax:           common.Bool(false),
							IsSkipRemainingRulesOnMatch: common.Bool(false),
							Key:                         common.String("EXAMPLE-key-Value"),
							ObjectStatus:                common.Int(814),
							IsCaseSensitive:             common.Bool(false),
							RuleType:                    dataintegration.TypeListRuleRuleTypeExclude,
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_40rQa": dataintegration.ConfigParameterValue{IntValue: common.Int(993),
								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")}},
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							Scope: &scope}},
						Scope: &scope,
						ScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
							ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
							ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShapeField}},
					Description: common.String("EXAMPLE-description-Value"),
					FromPattern: common.String("EXAMPLE-fromPattern-Value"),
					FromRuleConfig: &dataintegration.RuleTypeConfig{ObjectStatus: common.Int(566),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						IsOrderByRule: common.Bool(true),
						ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
						ProjectionRules: []dataintegration.ProjectionRule{dataintegration.NamePatternRule{Description: common.String("EXAMPLE-description-Value"),
							ObjectStatus: common.Int(302),
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							Scope: &scope,
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Zcvt8": dataintegration.ConfigParameterValue{IntValue: common.Int(883),
								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")}},
							IsCascade:                   common.Bool(true),
							Pattern:                     common.String("EXAMPLE-pattern-Value"),
							IsCaseSensitive:             common.Bool(true),
							IsSkipRemainingRulesOnMatch: common.Bool(false),
							ModelVersion:                common.String("EXAMPLE-modelVersion-Value"),
							IsJavaRegexSyntax:           common.Bool(false),
							Key:                         common.String("EXAMPLE-key-Value"),
							MatchingStrategy:            dataintegration.NamePatternRuleMatchingStrategyNameOrTags,
							RuleType:                    dataintegration.NamePatternRuleRuleTypeInclude}},
						Scope: &scope,
						ScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
							ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
							ReferenceType:   dataintegration.ScopeReferenceReferenceTypeOciFunctionInputShape},
						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_28DRR": dataintegration.ConfigParameterValue{IntValue: common.Int(353),
								ObjectValue:     &objectValue,
								ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
								RefValue:        &refValue,
								RootObjectValue: &rootObjectValue,
								StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
						Key: common.String("EXAMPLE-key-Value")},
					IsJavaRegexSyntax: common.Bool(false),
					Key:               common.String("EXAMPLE-key-Value"),
					MapType:           dataintegration.RuleBasedFieldMapMapTypeMapbyposition,
					ObjectStatus:      common.Int(67),
					ToPattern:         common.String("EXAMPLE-toPattern-Value")},
				ObjectStatus: common.Int(542),
				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"),
				FromLink: common.String("EXAMPLE-fromLink-Value"),
				Key:      common.String("EXAMPLE-key-Value")}},
			Key:          common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(348),
			Operator: dataintegration.Minus{ObjectStatus: common.Int(537),
				OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_zme6j": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(254)}},
					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{IsOutput: common.Bool(true),
					Key:          common.String("EXAMPLE-key-Value"),
					DefaultValue: &defaultValue,
					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,
					Description:            common.String("EXAMPLE-description-Value"),
					ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
					Type:                   &type_,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ZPdb8": dataintegration.ConfigParameterValue{IntValue: common.Int(421),
						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")}},
					Name:                  common.String("EXAMPLE-name-Value"),
					ObjectStatus:          common.Int(515),
					OutputAggregationType: dataintegration.ParameterOutputAggregationTypeCount,
					TypeName:              common.String("EXAMPLE-typeName-Value"),
					UsedFor:               common.String("EXAMPLE-usedFor-Value")}},
				Key:           common.String("EXAMPLE-key-Value"),
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				ObjectVersion: common.Int(685),
				OutputPorts: []dataintegration.TypedObject{dataintegration.AbstractField{Description: common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(222),
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-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_ya1eN": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(313),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}}}}},
				Identifier: common.String("EXAMPLE-identifier-Value"),
				InputPorts: []dataintegration.InputPort{dataintegration.InputPort{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_wxZ0r": dataintegration.ConfigParameterValue{IntValue: common.Int(496),
						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"),
					Fields: []dataintegration.TypedObject{dataintegration.Parameter{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						RootObjectDefaultValue: &rootObjectDefaultValue,
						Type:                   &type_,
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_752hY": dataintegration.ConfigParameterValue{IntValue: common.Int(373),
							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(false),
						Key:                   common.String("EXAMPLE-key-Value"),
						DefaultValue:          &defaultValue,
						Description:           common.String("EXAMPLE-description-Value"),
						IsInput:               common.Bool(true),
						Name:                  common.String("EXAMPLE-name-Value"),
						ObjectStatus:          common.Int(934),
						OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
						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"),
					ObjectStatus: common.Int(214),
					PortType:     dataintegration.InputPortPortTypeControl,
					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")},
				IsAll:       common.Bool(true),
				MinusType:   dataintegration.MinusMinusTypePosition,
				Description: common.String("EXAMPLE-description-Value"),
				Name:        common.String("EXAMPLE-name-Value")},
			OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(418),
				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"),
			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(8800.414),
				CoordinateY: common.Float32(4949.4507)}}},
			ObjectStatus: common.Int(62),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			RegistryMetadata: &dataintegration.RegistryMetadata{Labels: []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(853),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(false),
				Key:             common.String("EXAMPLE-key-Value")},
			FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_dbd6g": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(326),
				ObjectValue:     &objectValue}},
				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"),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsOutput: common.Bool(true),
				Key:                    common.String("EXAMPLE-key-Value"),
				ObjectStatus:           common.Int(588),
				OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeMax,
				RootObjectDefaultValue: &rootObjectDefaultValue,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_AlAbA": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(750),
					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")}},
				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")},
				TypeName:     common.String("EXAMPLE-typeName-Value"),
				DefaultValue: &defaultValue,
				Description:  common.String("EXAMPLE-description-Value"),
				IsInput:      common.Bool(true),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Type:         &type_}},
			Description: common.String("EXAMPLE-description-Value")}}

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

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