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

			}
,
		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_shdYd :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 731,
						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: 2,

			}
,
		methodType: dataintegration.models.UpdateTaskFromRestTask.MethodType.Patch,
		headers: "EXAMPLE-headers-Value",
		additionalProperties: "EXAMPLE-additionalProperties-Value",
		jsonData: "EXAMPLE-jsonData-Value",
		apiCallMode: dataintegration.models.UpdateTaskFromRestTask.ApiCallMode.AsyncOciWorkrequest,
		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_f3T4j :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 387,
						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: 144,

			}
,
		cancelMethodType: dataintegration.models.UpdateTaskFromRestTask.CancelMethodType.Patch,
		executeRestCallConfig: {
			methodType: dataintegration.models.ExecuteRestCallConfig.MethodType.Patch,
			requestHeaders: {
				EXAMPLE_KEY_WaKzy :"EXAMPLE_VALUE_gy8Smk5XwWC4gy63iX8H"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_PxURf :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 155,
						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.Post,
			requestHeaders: {
				EXAMPLE_KEY_fvUip :"EXAMPLE_VALUE_7rzbPSjp6t1cmmjtD6z3"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_lg82S :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 68,
						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.Patch,
			requestHeaders: {
				EXAMPLE_KEY_6i0sI :"EXAMPLE_VALUE_Bj7oBZD0pAPd1SJGSVtD"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_Clwvr :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 29,
						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_5BICx :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 697,
							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: 404,
				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: 12,
		objectVersion: 788,
		identifier: "EXAMPLE-identifier-Value",
		inputPorts: [{
				modelType: "INPUT_PORT",				portType: dataintegration.models.InputPort.PortType.Control,
				fields: [{
						modelType: "OUTPUT_FIELD",						type: {
							modelType: "COMPOSITE_TYPE",							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: 998,
								configParameterDefinitions: {
									EXAMPLE_KEY_WYLYA :{
										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: 343,
							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_mePEJ :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 474,
									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: 895,
						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_vHFp5 :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 215,
							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: 451,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		outputPorts: [{
				modelType: "OUTPUT_PORT",				portType: dataintegration.models.OutputPort.PortType.Control,
				fields: [{
						modelType: "INPUT_PORT",						portType: dataintegration.models.InputPort.PortType.Data,
						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_Tjm5e :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 230,
									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: 679,
						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_iC1H0 :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 230,
							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: 586,
				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.Max,
				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_tVMKl :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 215,
							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: 113,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		opConfigValues: {
			configParamValues: {
				EXAMPLE_KEY_sXpEM :{
					stringValue: "EXAMPLE-stringValue-Value",
					intValue: 661,
					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: 682,
			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: "ZUTOOFJDOIYQKAYIQV6N<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);
     }
})();