/** 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).
*/

import com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.dataintegration.DataIntegrationClient;
import com.oracle.bmc.dataintegration.model.*;
import com.oracle.bmc.dataintegration.requests.*;
import com.oracle.bmc.dataintegration.responses.*;
import java.math.BigDecimal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.UUID;
import java.util.Arrays;


public class CreateDataFlowExample {
    public static void main(String[] args) throws Exception {

        /**
         * 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.
         */
        final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
        final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);

        /* Create a service client */
        DataIntegrationClient client = DataIntegrationClient.builder().build(provider);

        /* Create a request and dependent object(s). */
	CreateDataFlowDetails createDataFlowDetails = CreateDataFlowDetails.builder()
		.key("EXAMPLE-key-Value")
		.modelVersion("EXAMPLE-modelVersion-Value")
		.parentRef(ParentReference.builder()
			.parent("EXAMPLE-parent-Value")
			.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
		.name("EXAMPLE-name-Value")
		.identifier("EXAMPLE-identifier-Value")
		.nodes(new ArrayList<>(Arrays.asList(FlowNode.builder()
				.key("EXAMPLE-key-Value")
				.modelType("EXAMPLE-modelType-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value")
					.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.inputLinks(new ArrayList<>(Arrays.asList(InputLink.builder()
						.fromLink("EXAMPLE-fromLink-Value")
						.fieldMap(RuleBasedFieldMap.builder()
							.key("EXAMPLE-key-Value")
							.modelVersion("EXAMPLE-modelVersion-Value")
							.parentRef(ParentReference.builder()
								.parent("EXAMPLE-parent-Value")
								.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_5T17L",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(955)
										.objectValue("EXAMPLE-objectValue-Value")
										.refValue("EXAMPLE-refValue-Value")
										.parameterValue("EXAMPLE-parameterValue-Value")
										.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
										}
 									})
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
							.mapType(RuleBasedFieldMap.MapType.Mapbyposition)
							.fromPattern("EXAMPLE-fromPattern-Value")
							.toPattern("EXAMPLE-toPattern-Value")
							.isJavaRegexSyntax(false)
							.objectStatus(850)
							.fromRuleConfig(RuleTypeConfig.builder()
								.key("EXAMPLE-key-Value")
								.modelVersion("EXAMPLE-modelVersion-Value")
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
								.scope("EXAMPLE-scope-Value")
								.scopeReference(ScopeReference.builder()
									.referenceObject("EXAMPLE-referenceObject-Value")
									.referenceType(ScopeReference.ReferenceType.DirectRef)
									.refObjectName("EXAMPLE-refObjectName-Value").build())
								.isOrderByRule(false)
								.projectionRules(new ArrayList<>(Arrays.asList(NamePatternRule.builder()
										.isSkipRemainingRulesOnMatch(true)
										.scope("EXAMPLE-scope-Value")
										.isCascade(true)
										.matchingStrategy(NamePatternRule.MatchingStrategy.NameOnly)
										.isCaseSensitive(true)
										.ruleType(NamePatternRule.RuleType.Exclude)
										.pattern("EXAMPLE-pattern-Value")
										.key("EXAMPLE-key-Value")
										.modelVersion("EXAMPLE-modelVersion-Value")
										.parentRef(ParentReference.builder()
											.parent("EXAMPLE-parent-Value")
											.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
										.isJavaRegexSyntax(true)
										.configValues(ConfigValues.builder()
											.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
													{
														put("EXAMPLE_KEY_JKx2d",ConfigParameterValue.builder()
													.stringValue("EXAMPLE-stringValue-Value")
													.intValue(92)
													.objectValue("EXAMPLE-objectValue-Value")
													.refValue("EXAMPLE-refValue-Value")
													.parameterValue("EXAMPLE-parameterValue-Value")
													.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
													}
 												})
											.parentRef(ParentReference.builder()
												.parent("EXAMPLE-parent-Value")
												.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
										.objectStatus(38)
										.description("EXAMPLE-description-Value").build())))
								.configValues(ConfigValues.builder()
									.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
											{
												put("EXAMPLE_KEY_G2wxx",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(486)
											.objectValue("EXAMPLE-objectValue-Value")
											.refValue("EXAMPLE-refValue-Value")
											.parameterValue("EXAMPLE-parameterValue-Value")
											.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
											}
 										})
									.parentRef(ParentReference.builder()
										.parent("EXAMPLE-parent-Value")
										.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
								.objectStatus(201).build())
							.toRuleConfig(RuleTypeConfig.builder()
								.key("EXAMPLE-key-Value")
								.modelVersion("EXAMPLE-modelVersion-Value")
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
								.scope("EXAMPLE-scope-Value")
								.scopeReference(ScopeReference.builder()
									.referenceObject("EXAMPLE-referenceObject-Value")
									.referenceType(ScopeReference.ReferenceType.DirectRef)
									.refObjectName("EXAMPLE-refObjectName-Value").build())
								.isOrderByRule(true)
								.projectionRules(new ArrayList<>(Arrays.asList(GroupedNamePatternRule.builder()
										.name("EXAMPLE-name-Value")
										.isSkipRemainingRulesOnMatch(true)
										.scope("EXAMPLE-scope-Value")
										.isCascade(false)
										.matchingStrategy(GroupedNamePatternRule.MatchingStrategy.TagsOnly)
										.isCaseSensitive(false)
										.ruleType(GroupedNamePatternRule.RuleType.Include)
										.pattern("EXAMPLE-pattern-Value")
										.key("EXAMPLE-key-Value")
										.modelVersion("EXAMPLE-modelVersion-Value")
										.parentRef(ParentReference.builder()
											.parent("EXAMPLE-parent-Value")
											.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
										.isJavaRegexSyntax(false)
										.configValues(ConfigValues.builder()
											.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
													{
														put("EXAMPLE_KEY_7Gwrm",ConfigParameterValue.builder()
													.stringValue("EXAMPLE-stringValue-Value")
													.intValue(581)
													.objectValue("EXAMPLE-objectValue-Value")
													.refValue("EXAMPLE-refValue-Value")
													.parameterValue("EXAMPLE-parameterValue-Value")
													.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
													}
 												})
											.parentRef(ParentReference.builder()
												.parent("EXAMPLE-parent-Value")
												.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
										.objectStatus(547)
										.description("EXAMPLE-description-Value").build())))
								.configValues(ConfigValues.builder()
									.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
											{
												put("EXAMPLE_KEY_cMG7C",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(200)
											.objectValue("EXAMPLE-objectValue-Value")
											.refValue("EXAMPLE-refValue-Value")
											.parameterValue("EXAMPLE-parameterValue-Value")
											.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
											}
 										})
									.parentRef(ParentReference.builder()
										.parent("EXAMPLE-parent-Value")
										.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
								.objectStatus(676).build())
							.description("EXAMPLE-description-Value").build())
						.key("EXAMPLE-key-Value")
						.modelVersion("EXAMPLE-modelVersion-Value")
						.parentRef(ParentReference.builder()
							.parent("EXAMPLE-parent-Value")
							.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
						.objectStatus(708)
						.description("EXAMPLE-description-Value")
						.port("EXAMPLE-port-Value").build())))
				.outputLinks(new ArrayList<>(Arrays.asList(OutputLink.builder()
						.toLinks(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.key("EXAMPLE-key-Value")
						.modelVersion("EXAMPLE-modelVersion-Value")
						.parentRef(ParentReference.builder()
							.parent("EXAMPLE-parent-Value")
							.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
						.objectStatus(494)
						.description("EXAMPLE-description-Value")
						.port("EXAMPLE-port-Value").build())))
				.operator(Split.builder()
					.dataRoutingStrategy(Split.DataRoutingStrategy.All)
					.key("EXAMPLE-key-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value")
						.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
					.name("EXAMPLE-name-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(365)
					.inputPorts(new ArrayList<>(Arrays.asList(InputPort.builder()
							.portType(InputPort.PortType.Model)
							.fields(new ArrayList<>(Arrays.asList(FlowPort.builder()
									.key("EXAMPLE-key-Value")
									.modelVersion("EXAMPLE-modelVersion-Value")
									.parentRef(ParentReference.builder()
										.parent("EXAMPLE-parent-Value")
										.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
									.configValues(ConfigValues.builder()
										.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
												{
													put("EXAMPLE_KEY_ZZ95l",ConfigParameterValue.builder()
												.stringValue("EXAMPLE-stringValue-Value")
												.intValue(116)
												.objectValue("EXAMPLE-objectValue-Value")
												.refValue("EXAMPLE-refValue-Value")
												.parameterValue("EXAMPLE-parameterValue-Value")
												.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
												}
 											})
										.parentRef(ParentReference.builder()
											.parent("EXAMPLE-parent-Value")
											.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
									.objectStatus(741)
									.name("EXAMPLE-name-Value")
									.description("EXAMPLE-description-Value").build())))
							.key("EXAMPLE-key-Value")
							.modelVersion("EXAMPLE-modelVersion-Value")
							.parentRef(ParentReference.builder()
								.parent("EXAMPLE-parent-Value")
								.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_uTQB4",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(361)
										.objectValue("EXAMPLE-objectValue-Value")
										.refValue("EXAMPLE-refValue-Value")
										.parameterValue("EXAMPLE-parameterValue-Value")
										.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
										}
 									})
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
							.objectStatus(529)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build())))
					.outputPorts(new ArrayList<>(Arrays.asList(ShapeField.builder()
							.type("EXAMPLE-type-Value")
							.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
							.nativeShapeField(NativeShapeField.builder()
								.name("EXAMPLE-name-Value")
								.modelType("EXAMPLE-modelType-Value")
								.type("EXAMPLE-type-Value")
								.configValues(ConfigValues.builder()
									.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
											{
												put("EXAMPLE_KEY_103ga",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(493)
											.objectValue("EXAMPLE-objectValue-Value")
											.refValue("EXAMPLE-refValue-Value")
											.parameterValue("EXAMPLE-parameterValue-Value")
											.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
											}
 										})
									.parentRef(ParentReference.builder()
										.parent("EXAMPLE-parent-Value")
										.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
								.position(655)
								.defaultValueString("EXAMPLE-defaultValueString-Value")
								.isMandatory(true).build())
							.key("EXAMPLE-key-Value")
							.modelVersion("EXAMPLE-modelVersion-Value")
							.parentRef(ParentReference.builder()
								.parent("EXAMPLE-parent-Value")
								.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_sFMUk",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(238)
										.objectValue("EXAMPLE-objectValue-Value")
										.refValue("EXAMPLE-refValue-Value")
										.parameterValue("EXAMPLE-parameterValue-Value")
										.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
										}
 									})
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
							.objectStatus(526)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build())))
					.objectStatus(73)
					.identifier("EXAMPLE-identifier-Value")
					.parameters(new ArrayList<>(Arrays.asList(Parameter.builder()
							.type("EXAMPLE-type-Value")
							.defaultValue("EXAMPLE-defaultValue-Value")
							.rootObjectDefaultValue("EXAMPLE-rootObjectDefaultValue-Value")
							.isInput(true)
							.isOutput(true)
							.outputAggregationType(Parameter.OutputAggregationType.Min)
							.typeName("EXAMPLE-typeName-Value")
							.usedFor("EXAMPLE-usedFor-Value")
							.key("EXAMPLE-key-Value")
							.modelVersion("EXAMPLE-modelVersion-Value")
							.parentRef(ParentReference.builder()
								.parent("EXAMPLE-parent-Value")
								.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_0U3St",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(725)
										.objectValue("EXAMPLE-objectValue-Value")
										.refValue("EXAMPLE-refValue-Value")
										.parameterValue("EXAMPLE-parameterValue-Value")
										.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
										}
 									})
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
							.objectStatus(127)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build())))
					.opConfigValues(ConfigValues.builder()
						.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
								{
									put("EXAMPLE_KEY_MXOlJ",ConfigParameterValue.builder()
								.stringValue("EXAMPLE-stringValue-Value")
								.intValue(260)
								.objectValue("EXAMPLE-objectValue-Value")
								.refValue("EXAMPLE-refValue-Value")
								.parameterValue("EXAMPLE-parameterValue-Value")
								.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
								}
 							})
						.parentRef(ParentReference.builder()
							.parent("EXAMPLE-parent-Value")
							.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build()).build())
				.uiProperties(UIProperties.builder()
					.coordinateX(new BigDecimal("4024.9688"))
					.coordinateY(new BigDecimal("8799.476")).build())
				.objectStatus(722).build())))
		.parameters(new ArrayList<>(Arrays.asList(Parameter.builder()
				.type("EXAMPLE-type-Value")
				.defaultValue("EXAMPLE-defaultValue-Value")
				.rootObjectDefaultValue("EXAMPLE-rootObjectDefaultValue-Value")
				.isInput(false)
				.isOutput(true)
				.outputAggregationType(Parameter.OutputAggregationType.Min)
				.typeName("EXAMPLE-typeName-Value")
				.usedFor("EXAMPLE-usedFor-Value")
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value")
					.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
				.configValues(ConfigValues.builder()
					.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
							{
								put("EXAMPLE_KEY_q7Bt8",ConfigParameterValue.builder()
							.stringValue("EXAMPLE-stringValue-Value")
							.intValue(406)
							.objectValue("EXAMPLE-objectValue-Value")
							.refValue("EXAMPLE-refValue-Value")
							.parameterValue("EXAMPLE-parameterValue-Value")
							.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
							}
 						})
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value")
						.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
				.objectStatus(815)
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value").build())))
		.description("EXAMPLE-description-Value")
		.flowConfigValues(ConfigValues.builder()
			.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
					{
						put("EXAMPLE_KEY_C9NqT",ConfigParameterValue.builder()
					.stringValue("EXAMPLE-stringValue-Value")
					.intValue(537)
					.objectValue("EXAMPLE-objectValue-Value")
					.refValue("EXAMPLE-refValue-Value")
					.parameterValue("EXAMPLE-parameterValue-Value")
					.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
					}
 				})
			.parentRef(ParentReference.builder()
				.parent("EXAMPLE-parent-Value")
				.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build()).build())
		.objectStatus(333)
		.registryMetadata(RegistryMetadata.builder()
			.aggregatorKey("EXAMPLE-aggregatorKey-Value")
			.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
			.registryVersion(73)
			.key("EXAMPLE-key-Value")
			.isFavorite(true).build()).build();

	CreateDataFlowRequest createDataFlowRequest = CreateDataFlowRequest.builder()
		.workspaceId("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")
		.createDataFlowDetails(createDataFlowDetails)
		.opcRetryToken("EXAMPLE-opcRetryToken-Value")
		.opcRequestId("J4QBDMZMXJXGPS8NQTAL<unique_ID>").build();

        /* Send request to the Client */
        CreateDataFlowResponse response = client.createDataFlow(createDataFlowRequest);
    }

    
}