// 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 type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	req := dataintegration.CreateDataFlowRequest{CreateDataFlowDetails: dataintegration.CreateDataFlowDetails{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")},
		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(234)},
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:                  common.String("EXAMPLE-name-Value"),
			OutputAggregationType: dataintegration.ParameterOutputAggregationTypeSum,
			Type:                  &type_,
			Description:           common.String("EXAMPLE-description-Value"),
			Key:                   common.String("EXAMPLE-key-Value"),
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")},
			RootObjectDefaultValue: &rootObjectDefaultValue,
			DefaultValue:           &defaultValue,
			IsInput:                common.Bool(false),
			UsedFor:                common.String("EXAMPLE-usedFor-Value"),
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_lRVSE": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
				StringValue:    common.String("EXAMPLE-stringValue-Value"),
				IntValue:       common.Int(817),
				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")}},
			IsOutput:     common.Bool(false),
			ObjectStatus: common.Int(671),
			TypeName:     common.String("EXAMPLE-typeName-Value")}},
		Description: common.String("EXAMPLE-description-Value"),
		FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ruOr4": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(391)}},
			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"),
		Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{ObjectStatus: common.Int(457),
			OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(208),
				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"),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			InputLinks: []dataintegration.InputLink{dataintegration.InputLink{FieldMap: dataintegration.RuleBasedEntityMap{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_HJWgh": dataintegration.ConfigParameterValue{IntValue: common.Int(382),
					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"),
				ModelVersion:      common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus:      common.Int(761),
				Description:       common.String("EXAMPLE-description-Value"),
				FromPattern:       common.String("EXAMPLE-fromPattern-Value"),
				IsJavaRegexSyntax: common.Bool(false),
				MapType:           dataintegration.RuleBasedEntityMapMapTypeMapbypattern},
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(891),
				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"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Port:         common.String("EXAMPLE-port-Value"),
				FromLink:     common.String("EXAMPLE-fromLink-Value")}},
			Name: common.String("EXAMPLE-name-Value"),
			Operator: dataintegration.StartOperator{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(914),
				OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_5gGQm": dataintegration.ConfigParameterValue{IntValue: common.Int(117),
					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")}},
				Parameters: []dataintegration.Parameter{dataintegration.Parameter{DefaultValue: &defaultValue,
					IsInput:  common.Bool(false),
					IsOutput: common.Bool(true),
					TypeName: common.String("EXAMPLE-typeName-Value"),
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ZnBLM": dataintegration.ConfigParameterValue{RefValue: &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(549),
						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"),
					ObjectStatus: common.Int(275),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					RootObjectDefaultValue: &rootObjectDefaultValue,
					UsedFor:                common.String("EXAMPLE-usedFor-Value"),
					Type:                   &type_,
					Description:            common.String("EXAMPLE-description-Value"),
					Key:                    common.String("EXAMPLE-key-Value"),
					Name:                   common.String("EXAMPLE-name-Value"),
					OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeMax}},
				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"),
				InputPorts: []dataintegration.InputPort{dataintegration.InputPort{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")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_3pxTw": dataintegration.ConfigParameterValue{IntValue: common.Int(775),
						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")}},
					Description:  common.String("EXAMPLE-description-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(387),
					PortType:     dataintegration.InputPortPortTypeData,
					Fields: []dataintegration.TypedObject{dataintegration.DecisionOutputPort{DecisionOutputPortType: dataintegration.DecisionOutputPortDecisionOutputPortTypeTrue,
						Description:  common.String("EXAMPLE-description-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(516),
						PortType:     dataintegration.DecisionOutputPortPortTypeModel,
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_WxZZb": dataintegration.ConfigParameterValue{IntValue: common.Int(366),
							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"),
						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"),
				ObjectVersion: common.Int(326),
				OutputPorts: []dataintegration.TypedObject{dataintegration.AbstractField{ObjectStatus: common.Int(752),
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_T0Ozx": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(1),
						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"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value")}},
				Description: common.String("EXAMPLE-description-Value")},
			UiProperties: &dataintegration.UiProperties{CoordinateX: common.Float32(7786.455),
				CoordinateY: common.Float32(9010.642)}}},
		ObjectStatus: common.Int(352)},
		OpcRequestId:  common.String("NKOXSIEKXUTDAR840UDU<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)
}