// 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{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		CreateDataFlowDetails: dataintegration.CreateDataFlowDetails{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name: common.String("EXAMPLE-name-Value"),
			Nodes: []dataintegration.FlowNode{dataintegration.FlowNode{InputLinks: []dataintegration.InputLink{dataintegration.InputLink{Description: common.String("EXAMPLE-description-Value"),
				FromLink:     common.String("EXAMPLE-fromLink-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Port:         common.String("EXAMPLE-port-Value"),
				FieldMap: dataintegration.CompositeFieldMap{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(970),
					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_hrEUT": dataintegration.ConfigParameterValue{IntValue: common.Int(713),
						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"),
					Key:         common.String("EXAMPLE-key-Value")},
				Key:          common.String("EXAMPLE-key-Value"),
				ObjectStatus: common.Int(975),
				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"),
				ObjectStatus: common.Int(111),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				Operator: dataintegration.Minus{OutputPorts: []dataintegration.TypedObject{dataintegration.OutputPort{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					PortType: dataintegration.OutputPortPortTypeModel,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_5dlyj": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(501),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue}},
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(983),
					Description:  common.String("EXAMPLE-description-Value"),
					Name:         common.String("EXAMPLE-name-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")},
						Description: common.String("EXAMPLE-description-Value"),
						Fields: []dataintegration.TypedObject{dataintegration.DynamicInputField{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(343),
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_YyI1y": dataintegration.ConfigParameterValue{IntValue: common.Int(108),
								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")}},
							Labels: []string{"EXAMPLE--Value"},
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							Type: dataintegration.MapType{Name: common.String("EXAMPLE-name-Value"),
								ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
								Key:              common.String("EXAMPLE-key-Value"),
								KeyElementType:   common.String("EXAMPLE-keyElementType-Value"),
								ObjectStatus:     common.Int(891),
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
								ContainsNull: common.Bool(true),
								Description:  common.String("EXAMPLE-description-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value")}}},
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(931),
						PortType:     dataintegration.InputPortPortTypeControl,
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_10oaC": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(786)}},
							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")}},
					MinusType:    dataintegration.MinusMinusTypePosition,
					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")},
					Key: common.String("EXAMPLE-key-Value"),
					OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_PON01": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(170),
						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")}},
					ObjectVersion: common.Int(44),
					Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsInput: common.Bool(true),
						Key:                   common.String("EXAMPLE-key-Value"),
						ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
						OutputAggregationType: dataintegration.ParameterOutputAggregationTypeCount,
						TypeName:              common.String("EXAMPLE-typeName-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_vOzl5": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
							RefValue:        &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(23),
							ObjectValue:     &objectValue}},
							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")},
						Type:                   &type_,
						Description:            common.String("EXAMPLE-description-Value"),
						ObjectStatus:           common.Int(383),
						UsedFor:                common.String("EXAMPLE-usedFor-Value"),
						DefaultValue:           &defaultValue,
						IsOutput:               common.Bool(true),
						RootObjectDefaultValue: &rootObjectDefaultValue}},
					Description:  common.String("EXAMPLE-description-Value"),
					IsAll:        common.Bool(false),
					ObjectStatus: common.Int(223),
					Identifier:   common.String("EXAMPLE-identifier-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(389),
					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(6756.262),
					CoordinateY: common.Float32(8661.631)},
				Description: common.String("EXAMPLE-description-Value")}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			RegistryMetadata: &dataintegration.RegistryMetadata{IsFavorite: common.Bool(false),
				Key:             common.String("EXAMPLE-key-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(848),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value")},
			Description:  common.String("EXAMPLE-description-Value"),
			ObjectStatus: common.Int(750),
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{TypeName: common.String("EXAMPLE-typeName-Value"),
				IsInput:                common.Bool(false),
				Name:                   common.String("EXAMPLE-name-Value"),
				ObjectStatus:           common.Int(324),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				Description:            common.String("EXAMPLE-description-Value"),
				Type:                   &type_,
				IsOutput:               common.Bool(true),
				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")},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_9ZKos": dataintegration.ConfigParameterValue{IntValue: common.Int(815),
					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")}},
				DefaultValue:          &defaultValue,
				ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax}},
			FlowConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_mL7MB": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(129)}},
				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")},
		OpcRequestId: common.String("YH6JTDIAEC1BOJHCGQJQ<unique_ID>")}

	// 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)
}