// 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 rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var scope interface{}
	scope = "EXAMPLE-scope-Value"
	req := dataintegration.CreateDataFlowRequest{CreateDataFlowDetails: dataintegration.CreateDataFlowDetails{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")},
		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_AMACy": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(306)}}},
		Description:            common.String("EXAMPLE-description-Value"),
		IsInput:                common.Bool(false),
		IsOutput:               common.Bool(false),
		RootObjectDefaultValue: &rootObjectDefaultValue,
		TypeName:               common.String("EXAMPLE-typeName-Value"),
		Name:                   common.String("EXAMPLE-name-Value"),
		DefaultValue:           &defaultValue,
		Key:                    common.String("EXAMPLE-key-Value"),
		ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
		ObjectStatus:           common.Int(325),
		Type:                   &type_,
		OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeMin}},
		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")},
		RegistryMetadata: &dataintegration.RegistryMetadata{Labels: []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(71),
			AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
			IsFavorite:      common.Bool(true),
			Key:             common.String("EXAMPLE-key-Value")},
		Description: common.String("EXAMPLE-description-Value"),
		FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_IlsnN": dataintegration.ConfigParameterValue{IntValue: common.Int(69),
			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")}},
		Identifier:   common.String("EXAMPLE-identifier-Value"),
		Key:          common.String("EXAMPLE-key-Value"),
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Description: common.String("EXAMPLE-description-Value"),
			InputLinks: []dataintegration.InputLink{dataintegration.InputLink{Port: common.String("EXAMPLE-port-Value"),
				Description: common.String("EXAMPLE-description-Value"),
				FieldMap: dataintegration.CompositeFieldMap{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(523),
					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_OJOX0": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(472),
						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"),
					Key:         common.String("EXAMPLE-key-Value")},
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(968),
				ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
					Parent: common.String("EXAMPLE-parent-Value")},
				FromLink:     common.String("EXAMPLE-fromLink-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
			Key:          common.String("EXAMPLE-key-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(863),
			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(4234.6885),
				CoordinateY: common.Float32(3995.7488)},
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Operator: dataintegration.Filter{Identifier: common.String("EXAMPLE-identifier-Value"),
				InputPorts: []dataintegration.InputPort{dataintegration.InputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_LtAUv": dataintegration.ConfigParameterValue{IntValue: common.Int(573),
					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"),
					ObjectStatus: common.Int(520),
					Description:  common.String("EXAMPLE-description-Value"),
					Fields: []dataintegration.TypedObject{dataintegration.InputField{ObjectStatus: common.Int(904),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_431XU": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(220),
							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")}},
						Key:    common.String("EXAMPLE-key-Value"),
						Labels: []string{"EXAMPLE--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")},
						Type: dataintegration.DataType{Name: common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(983),
							Description:  common.String("EXAMPLE-description-Value"),
							DtType:       dataintegration.DataTypeDtTypePrimitive,
							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")},
							TypeSystemName: common.String("EXAMPLE-typeSystemName-Value"),
							ConfigDefinition: &dataintegration.ConfigDefinition{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(847),
								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_5iGkB": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
									DefaultValue:      &defaultValue,
									Description:       common.String("EXAMPLE-description-Value"),
									IsClassFieldValue: common.Bool(false),
									IsStatic:          common.Bool(true),
									ParameterName:     common.String("EXAMPLE-parameterName-Value")}}},
							Key: common.String("EXAMPLE-key-Value")},
						Description:  common.String("EXAMPLE-description-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
					Key:  common.String("EXAMPLE-key-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")},
					PortType: dataintegration.InputPortPortTypeData}},
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				Name:          common.String("EXAMPLE-name-Value"),
				ObjectVersion: common.Int(753),
				OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_h77DQ": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(128)}},
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
				OutputPorts: []dataintegration.TypedObject{dataintegration.ProxyField{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"),
					Labels:       []string{"EXAMPLE--Value"},
					ObjectStatus: common.Int(328),
					Scope:        &scope,
					ScopeReference: &dataintegration.ScopeReference{ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
						ReferenceType: dataintegration.ScopeReferenceReferenceTypeOciFunctionInputShape,
						RefObjectName: common.String("EXAMPLE-refObjectName-Value")},
					Type: dataintegration.JavaType{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						ConfigDefinition: &dataintegration.ConfigDefinition{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							Name:         common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(830),
							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_SzAYO": 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")}},
							IsContained: common.Bool(false),
							Key:         common.String("EXAMPLE-key-Value")},
						Description:  common.String("EXAMPLE-description-Value"),
						JavaTypeName: common.String("EXAMPLE-javaTypeName-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(714)},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_pbU26": dataintegration.ConfigParameterValue{IntValue: common.Int(814),
						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")}},
					Key: common.String("EXAMPLE-key-Value")}},
				Description: common.String("EXAMPLE-description-Value"),
				FilterCondition: &dataintegration.Expression{ObjectStatus: common.Int(504),
					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_egH9h": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(503),
						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")}},
					ExprString:   common.String("EXAMPLE-exprString-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value")},
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(659),
				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")},
					DefaultValue: &defaultValue,
					IsOutput:     common.Bool(false),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(860),
					TypeName:     common.String("EXAMPLE-typeName-Value"),
					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_LDZ5Q": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
							StringValue:    common.String("EXAMPLE-stringValue-Value"),
							IntValue:       common.Int(507),
							ObjectValue:    &objectValue,
							ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
							RefValue:       &refValue}}},
					IsInput:                common.Bool(true),
					Key:                    common.String("EXAMPLE-key-Value"),
					OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeSum,
					RootObjectDefaultValue: &rootObjectDefaultValue,
					Type:                   &type_,
					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")}},
			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")}}}},
		ObjectStatus: common.Int(507)},
		OpcRequestId:  common.String("Z74HFSGMW3MNITGBEMIV<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-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)
}