// 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 type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	req := dataintegration.CreateDataFlowRequest{CreateDataFlowDetails: dataintegration.CreateDataFlowDetails{Identifier: common.String("EXAMPLE-identifier-Value"),
		Key:          common.String("EXAMPLE-key-Value"),
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		ObjectStatus: common.Int(318),
		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_MsqRd": dataintegration.ConfigParameterValue{IntValue: common.Int(313),
				ObjectValue:     &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
		Name: common.String("EXAMPLE-name-Value"),
		Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{Description: common.String("EXAMPLE-description-Value"),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			ObjectStatus: common.Int(196),
			Operator: dataintegration.ExpressionOperator{Parameters: []dataintegration.Parameter{dataintegration.Parameter{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_OkWGz": dataintegration.ConfigParameterValue{IntValue: common.Int(873),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
				IsInput:               common.Bool(true),
				Name:                  common.String("EXAMPLE-name-Value"),
				ObjectStatus:          common.Int(618),
				Type:                  &type_,
				DefaultValue:          &defaultValue,
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				IsOutput:               common.Bool(false),
				ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				Description:            common.String("EXAMPLE-description-Value"),
				Key:                    common.String("EXAMPLE-key-Value"),
				TypeName:               common.String("EXAMPLE-typeName-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"),
				InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Description: common.String("EXAMPLE-description-Value"),
					Fields: []dataintegration.TypedObject{dataintegration.OutputField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_7wFi3": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(301)}},
						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"),
						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.DerivedType{Key: common.String("EXAMPLE-key-Value"),
							ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							Name:         common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(28),
							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")},
						Description:  common.String("EXAMPLE-description-Value"),
						Labels:       []string{"EXAMPLE--Value"},
						ObjectStatus: common.Int(153)}},
					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{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_U0jdl": dataintegration.ConfigParameterValue{IntValue: common.Int(771),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(78),
					PortType:     dataintegration.InputPortPortTypeModel}},
				Key:  common.String("EXAMPLE-key-Value"),
				Name: common.String("EXAMPLE-name-Value"),
				OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_9Lonx": dataintegration.ConfigParameterValue{IntValue: common.Int(684),
					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.OutputField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_kO90l": dataintegration.ConfigParameterValue{RefValue: &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(135),
					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")}},
					Labels: []string{"EXAMPLE--Value"},
					Name:   common.String("EXAMPLE-name-Value"),
					Type: dataintegration.MapType{Description: common.String("EXAMPLE-description-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(601),
						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"),
						ContainsNull:     common.Bool(false),
						Key:              common.String("EXAMPLE-key-Value"),
						KeyElementType:   common.String("EXAMPLE-keyElementType-Value"),
						Name:             common.String("EXAMPLE-name-Value")},
					Description:  common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(638),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
				TriggerRule:   dataintegration.ExpressionOperatorTriggerRuleComplete,
				Identifier:    common.String("EXAMPLE-identifier-Value"),
				ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus:  common.Int(385),
				ObjectVersion: common.Int(940)},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			InputLinks: []dataintegration.InputLink{dataintegration.InputLink{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")},
				Port: common.String("EXAMPLE-port-Value"),
				FieldMap: dataintegration.CompositeFieldMap{Description: common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(294),
					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_Sg5rT": dataintegration.ConfigParameterValue{IntValue: common.Int(842),
						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")}}},
				FromLink:     common.String("EXAMPLE-fromLink-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(200),
				Description:  common.String("EXAMPLE-description-Value")}},
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			OutputLinks: []dataintegration.OutputLink{dataintegration.OutputLink{Description: common.String("EXAMPLE-description-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(61),
				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"}}},
			UiProperties: &dataintegration.UiProperties{CoordinateX: common.Float32(8889.733),
				CoordinateY: common.Float32(8972.483)}}},
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_PsFMF": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(268),
			ObjectValue:     &objectValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			DefaultValue:          &defaultValue,
			IsInput:               common.Bool(true),
			ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
			Description:           common.String("EXAMPLE-description-Value"),
			IsOutput:              common.Bool(false),
			Key:                   common.String("EXAMPLE-key-Value"),
			ObjectStatus:          common.Int(624),
			OutputAggregationType: dataintegration.ParameterOutputAggregationTypeSum,
			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"),
			Name:                   common.String("EXAMPLE-name-Value"),
			RootObjectDefaultValue: &rootObjectDefaultValue,
			Type:                   &type_,
			TypeName:               common.String("EXAMPLE-typeName-Value")}},
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		RegistryMetadata: &dataintegration.RegistryMetadata{RegistryVersion: common.Int(50),
			AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
			IsFavorite:    common.Bool(true),
			Key:           common.String("EXAMPLE-key-Value"),
			Labels:        []string{"EXAMPLE--Value"}},
		Description: common.String("EXAMPLE-description-Value")},
		OpcRequestId:  common.String("Y7NKGEIBC1S4Z9WROYRC<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)
}