// 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 * as dataintegration from "oci-dataintegration";
import common = require("oci-common");

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

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new dataintegration.DataIntegrationClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  updateTaskDetails = {
		modelType: "REST_TASK",		authDetails: {
			key: "EXAMPLE-key-Value",
			modelVersion: "EXAMPLE-modelVersion-Value",
			parentRef: {
				parent: "EXAMPLE-parent-Value",
				rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

				}
,
			modelType: dataintegration.models.AuthDetails.ModelType.ResourcePrincipalAuthDetails,

			}
,
		authConfig: {
			modelType: "OCI_RESOURCE_AUTH_CONFIG",			resourcePrincipalSource: dataintegration.models.ResourcePrincipalAuthConfig.ResourcePrincipalSource.Workspace,
			key: "EXAMPLE-key-Value",
			modelVersion: "EXAMPLE-modelVersion-Value",
			parentRef: {
				parent: "EXAMPLE-parent-Value",
				rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

				}


			}
,
		endpoint: {
			key: "EXAMPLE-key-Value",
			modelType: "EXAMPLE-modelType-Value",
			modelVersion: "EXAMPLE-modelVersion-Value",
			parentRef: {
				parent: "EXAMPLE-parent-Value",
				rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

				}
,
			exprString: "EXAMPLE-exprString-Value",
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_URnLE :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 378,
						objectValue: "EXAMPLE-objectValue-Value",
						refValue: "EXAMPLE-refValue-Value",
						parameterValue: "EXAMPLE-parameterValue-Value",
						rootObjectValue: "EXAMPLE-rootObjectValue-Value",

						}

					},
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,

				}
,
			objectStatus: 161,

			}
,
		methodType: dataintegration.models.UpdateTaskFromRestTask.MethodType.Put,
		headers: "EXAMPLE-headers-Value",
		additionalProperties: "EXAMPLE-additionalProperties-Value",
		jsonData: "EXAMPLE-jsonData-Value",
		apiCallMode: dataintegration.models.UpdateTaskFromRestTask.ApiCallMode.Synchronous,
		cancelEndpoint: {
			key: "EXAMPLE-key-Value",
			modelType: "EXAMPLE-modelType-Value",
			modelVersion: "EXAMPLE-modelVersion-Value",
			parentRef: {
				parent: "EXAMPLE-parent-Value",
				rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

				}
,
			exprString: "EXAMPLE-exprString-Value",
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_AIGad :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 505,
						objectValue: "EXAMPLE-objectValue-Value",
						refValue: "EXAMPLE-refValue-Value",
						parameterValue: "EXAMPLE-parameterValue-Value",
						rootObjectValue: "EXAMPLE-rootObjectValue-Value",

						}

					},
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,

				}
,
			objectStatus: 666,

			}
,
		cancelMethodType: dataintegration.models.UpdateTaskFromRestTask.CancelMethodType.Delete,
		executeRestCallConfig: {
			methodType: dataintegration.models.ExecuteRestCallConfig.MethodType.Post,
			requestHeaders: {
				EXAMPLE_KEY_0Vsqz :"EXAMPLE_VALUE_r47zIDYPj9OtTPqu8S8C"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_MGsuo :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 937,
						objectValue: "EXAMPLE-objectValue-Value",
						refValue: "EXAMPLE-refValue-Value",
						parameterValue: "EXAMPLE-parameterValue-Value",
						rootObjectValue: "EXAMPLE-rootObjectValue-Value",

						}

					},
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,

				}
,

			}
,
		cancelRestCallConfig: {
			methodType: dataintegration.models.CancelRestCallConfig.MethodType.Delete,
			requestHeaders: {
				EXAMPLE_KEY_ulemm :"EXAMPLE_VALUE_fG18ppiMwfAVigZc2Bs2"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_FUqp0 :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 519,
						objectValue: "EXAMPLE-objectValue-Value",
						refValue: "EXAMPLE-refValue-Value",
						parameterValue: "EXAMPLE-parameterValue-Value",
						rootObjectValue: "EXAMPLE-rootObjectValue-Value",

						}

					},
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,

				}
,

			}
,
		pollRestCallConfig: {
			methodType: dataintegration.models.PollRestCallConfig.MethodType.Post,
			requestHeaders: {
				EXAMPLE_KEY_VXgZO :"EXAMPLE_VALUE_qtR4lGZbP8LAP50ncmUg"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_cgttL :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 265,
						objectValue: "EXAMPLE-objectValue-Value",
						refValue: "EXAMPLE-refValue-Value",
						parameterValue: "EXAMPLE-parameterValue-Value",
						rootObjectValue: "EXAMPLE-rootObjectValue-Value",

						}

					},
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,

				}
,

			}
,
		typedExpressions: [{
				modelType: "TYPED_EXPRESSION",				expression: "EXAMPLE-expression-Value",
				type: "EXAMPLE-type-Value",
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,
				configValues: {
					configParamValues: {
						EXAMPLE_KEY_xCFbc :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 753,
							objectValue: "EXAMPLE-objectValue-Value",
							refValue: "EXAMPLE-refValue-Value",
							parameterValue: "EXAMPLE-parameterValue-Value",
							rootObjectValue: "EXAMPLE-rootObjectValue-Value",

							}

						},
					parentRef: {
						parent: "EXAMPLE-parent-Value",
						rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

						}
,

					}
,
				objectStatus: 68,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		key: "EXAMPLE-key-Value",
		modelVersion: "EXAMPLE-modelVersion-Value",
		parentRef: {
			parent: "EXAMPLE-parent-Value",
			rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

			}
,
		name: "EXAMPLE-name-Value",
		description: "EXAMPLE-description-Value",
		objectStatus: 423,
		objectVersion: 246,
		identifier: "EXAMPLE-identifier-Value",
		inputPorts: [{
				modelType: "INPUT_PORT",				portType: dataintegration.models.InputPort.PortType.Data,
				fields: [{
						modelType: "INPUT_PROXY_FIELD",						scope: "EXAMPLE-scope-Value",
						type: {
							modelType: "JAVA_TYPE",							javaTypeName: "EXAMPLE-javaTypeName-Value",
							configDefinition: {
								key: "EXAMPLE-key-Value",
								modelType: "EXAMPLE-modelType-Value",
								modelVersion: "EXAMPLE-modelVersion-Value",
								parentRef: {
									parent: "EXAMPLE-parent-Value",
									rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

									}
,
								name: "EXAMPLE-name-Value",
								isContained: false,
								objectStatus: 733,
								configParameterDefinitions: {
									EXAMPLE_KEY_eNYUV :{
										parameterName: "EXAMPLE-parameterName-Value",
										description: "EXAMPLE-description-Value",
										defaultValue: "EXAMPLE-defaultValue-Value",
										classFieldName: "EXAMPLE-classFieldName-Value",
										isStatic: true,
										isClassFieldValue: false,

										}

									},

								}
,
							key: "EXAMPLE-key-Value",
							modelVersion: "EXAMPLE-modelVersion-Value",
							parentRef: {
								parent: "EXAMPLE-parent-Value",
								rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

								}
,
							name: "EXAMPLE-name-Value",
							objectStatus: 396,
							description: "EXAMPLE-description-Value"

							}
,
						labels: ["EXAMPLE--Value"								],
						key: "EXAMPLE-key-Value",
						modelVersion: "EXAMPLE-modelVersion-Value",
						parentRef: {
							parent: "EXAMPLE-parent-Value",
							rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

							}
,
						configValues: {
							configParamValues: {
								EXAMPLE_KEY_wcU4N :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 842,
									objectValue: "EXAMPLE-objectValue-Value",
									refValue: "EXAMPLE-refValue-Value",
									parameterValue: "EXAMPLE-parameterValue-Value",
									rootObjectValue: "EXAMPLE-rootObjectValue-Value",

									}

								},
							parentRef: {
								parent: "EXAMPLE-parent-Value",
								rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

								}
,

							}
,
						objectStatus: 221,
						name: "EXAMPLE-name-Value",
						description: "EXAMPLE-description-Value"

						}
						],
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,
				configValues: {
					configParamValues: {
						EXAMPLE_KEY_OWaKz :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 386,
							objectValue: "EXAMPLE-objectValue-Value",
							refValue: "EXAMPLE-refValue-Value",
							parameterValue: "EXAMPLE-parameterValue-Value",
							rootObjectValue: "EXAMPLE-rootObjectValue-Value",

							}

						},
					parentRef: {
						parent: "EXAMPLE-parent-Value",
						rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

						}
,

					}
,
				objectStatus: 936,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		outputPorts: [{
				modelType: "OUTPUT_PORT",				portType: dataintegration.models.OutputPort.PortType.Data,
				fields: [{
						modelType: "CONDITIONAL_OUTPUT_PORT",						portType: dataintegration.models.ConditionalOutputPort.PortType.Data,
						splitCondition: {
							key: "EXAMPLE-key-Value",
							modelType: "EXAMPLE-modelType-Value",
							modelVersion: "EXAMPLE-modelVersion-Value",
							parentRef: {
								parent: "EXAMPLE-parent-Value",
								rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

								}
,
							exprString: "EXAMPLE-exprString-Value",
							configValues: {
								configParamValues: {
									EXAMPLE_KEY_Agzkt :{
										stringValue: "EXAMPLE-stringValue-Value",
										intValue: 56,
										objectValue: "EXAMPLE-objectValue-Value",
										refValue: "EXAMPLE-refValue-Value",
										parameterValue: "EXAMPLE-parameterValue-Value",
										rootObjectValue: "EXAMPLE-rootObjectValue-Value",

										}

									},
								parentRef: {
									parent: "EXAMPLE-parent-Value",
									rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

									}
,

								}
,
							objectStatus: 450,

							}
,
						key: "EXAMPLE-key-Value",
						modelVersion: "EXAMPLE-modelVersion-Value",
						parentRef: {
							parent: "EXAMPLE-parent-Value",
							rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

							}
,
						configValues: {
							configParamValues: {
								EXAMPLE_KEY_8VY0K :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 415,
									objectValue: "EXAMPLE-objectValue-Value",
									refValue: "EXAMPLE-refValue-Value",
									parameterValue: "EXAMPLE-parameterValue-Value",
									rootObjectValue: "EXAMPLE-rootObjectValue-Value",

									}

								},
							parentRef: {
								parent: "EXAMPLE-parent-Value",
								rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

								}
,

							}
,
						objectStatus: 707,
						name: "EXAMPLE-name-Value",
						description: "EXAMPLE-description-Value"

						}
						],
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,
				configValues: {
					configParamValues: {
						EXAMPLE_KEY_Bj7oB :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 486,
							objectValue: "EXAMPLE-objectValue-Value",
							refValue: "EXAMPLE-refValue-Value",
							parameterValue: "EXAMPLE-parameterValue-Value",
							rootObjectValue: "EXAMPLE-rootObjectValue-Value",

							}

						},
					parentRef: {
						parent: "EXAMPLE-parent-Value",
						rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

						}
,

					}
,
				objectStatus: 729,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		parameters: [{
				modelType: "PARAMETER",				type: "EXAMPLE-type-Value",
				defaultValue: "EXAMPLE-defaultValue-Value",
				rootObjectDefaultValue: "EXAMPLE-rootObjectDefaultValue-Value",
				isInput: true,
				isOutput: false,
				outputAggregationType: dataintegration.models.Parameter.OutputAggregationType.Min,
				typeName: "EXAMPLE-typeName-Value",
				usedFor: "EXAMPLE-usedFor-Value",
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				parentRef: {
					parent: "EXAMPLE-parent-Value",
					rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

					}
,
				configValues: {
					configParamValues: {
						EXAMPLE_KEY_vPU42 :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 682,
							objectValue: "EXAMPLE-objectValue-Value",
							refValue: "EXAMPLE-refValue-Value",
							parameterValue: "EXAMPLE-parameterValue-Value",
							rootObjectValue: "EXAMPLE-rootObjectValue-Value",

							}

						},
					parentRef: {
						parent: "EXAMPLE-parent-Value",
						rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

						}
,

					}
,
				objectStatus: 398,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		opConfigValues: {
			configParamValues: {
				EXAMPLE_KEY_5WY0L :{
					stringValue: "EXAMPLE-stringValue-Value",
					intValue: 218,
					objectValue: "EXAMPLE-objectValue-Value",
					refValue: "EXAMPLE-refValue-Value",
					parameterValue: "EXAMPLE-parameterValue-Value",
					rootObjectValue: "EXAMPLE-rootObjectValue-Value",

					}

				},
			parentRef: {
				parent: "EXAMPLE-parent-Value",
				rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value",

				}
,

			}
,
		isConcurrentAllowed: false,
		registryMetadata: {
			aggregatorKey: "EXAMPLE-aggregatorKey-Value",
			labels: ["EXAMPLE--Value"					],
			registryVersion: 991,
			key: "EXAMPLE-key-Value",
			isFavorite: true,

			}


		}

	const updateTaskRequest: dataintegration.requests.UpdateTaskRequest = { 
	workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
	taskKey: "EXAMPLE-taskKey-Value",
	updateTaskDetails: updateTaskDetails,
	opcRequestId: "QF34GSHIHMZLTZAB6FSK<unique_ID>",
	ifMatch: "EXAMPLE-ifMatch-Value",

		}; 


     // Send request to the Client.
     const updateTaskResponse = await client.updateTask(updateTaskRequest);
     }
     catch (error) {
         console.log("updateTask Failed with error  " + error);
     }
})();