/** 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 UpdateTaskExample {
    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). */
	UpdateTaskDetails updateTaskDetails = UpdateTaskFromSQLTask.builder()
		.script(Script.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())
			.objectStatus(293).build())
		.sqlScriptType(UpdateTaskFromSQLTask.SqlScriptType.StoredProcedure)
		.operation("EXAMPLE-operation-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())
		.name("EXAMPLE-name-Value")
		.description("EXAMPLE-description-Value")
		.objectStatus(859)
		.objectVersion(544)
		.identifier("EXAMPLE-identifier-Value")
		.inputPorts(new ArrayList<>(Arrays.asList(InputPort.builder()
				.portType(InputPort.PortType.Control)
				.fields(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_DzQT7",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(522)
										.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(612)
							.defaultValueString("EXAMPLE-defaultValueString-Value")
							.isMandatory(false).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_1dIPE",ConfigParameterValue.builder()
									.stringValue("EXAMPLE-stringValue-Value")
									.intValue(694)
									.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(58)
						.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_R3QX0",ConfigParameterValue.builder()
							.stringValue("EXAMPLE-stringValue-Value")
							.intValue(308)
							.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(41)
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value").build())))
		.outputPorts(new ArrayList<>(Arrays.asList(OutputPort.builder()
				.portType(OutputPort.PortType.Model)
				.fields(new ArrayList<>(Arrays.asList(ConditionalOutputPort.builder()
						.portType(ConditionalOutputPort.PortType.Control)
						.splitCondition(Expression.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())
							.exprString("EXAMPLE-exprString-Value")
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_ci7i6",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(46)
										.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(744).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_15xbs",ConfigParameterValue.builder()
									.stringValue("EXAMPLE-stringValue-Value")
									.intValue(312)
									.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(912)
						.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_c45tH",ConfigParameterValue.builder()
							.stringValue("EXAMPLE-stringValue-Value")
							.intValue(7)
							.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(513)
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value").build())))
		.parameters(new ArrayList<>(Arrays.asList(Parameter.builder()
				.type("EXAMPLE-type-Value")
				.defaultValue("EXAMPLE-defaultValue-Value")
				.rootObjectDefaultValue("EXAMPLE-rootObjectDefaultValue-Value")
				.isInput(true)
				.isOutput(false)
				.outputAggregationType(Parameter.OutputAggregationType.Sum)
				.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_Dd1Ne",ConfigParameterValue.builder()
							.stringValue("EXAMPLE-stringValue-Value")
							.intValue(799)
							.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(979)
				.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_T42RP",ConfigParameterValue.builder()
					.stringValue("EXAMPLE-stringValue-Value")
					.intValue(971)
					.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())
		.isConcurrentAllowed(true)
		.registryMetadata(RegistryMetadata.builder()
			.aggregatorKey("EXAMPLE-aggregatorKey-Value")
			.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
			.registryVersion(615)
			.key("EXAMPLE-key-Value")
			.isFavorite(true).build()).build();

	UpdateTaskRequest updateTaskRequest = UpdateTaskRequest.builder()
		.workspaceId("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")
		.taskKey("EXAMPLE-taskKey-Value")
		.updateTaskDetails(updateTaskDetails)
		.opcRequestId("HPIDHNIA4V1PFL1G3PGV<unique_ID>")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

        /* Send request to the Client */
        UpdateTaskResponse response = client.updateTask(updateTaskRequest);
    }

    
}