// 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  createTaskDetails = {
		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.Application,
			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_2Nv3w :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 923,
						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: 352,

			}
,
		methodType: dataintegration.models.CreateTaskFromRestTask.MethodType.Delete,
		headers: "EXAMPLE-headers-Value",
		jsonData: "EXAMPLE-jsonData-Value",
		apiCallMode: dataintegration.models.CreateTaskFromRestTask.ApiCallMode.AsyncGeneric,
		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_qtW59 :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 948,
						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: 667,

			}
,
		cancelMethodType: dataintegration.models.CreateTaskFromRestTask.CancelMethodType.Patch,
		executeRestCallConfig: {
			methodType: dataintegration.models.ExecuteRestCallConfig.MethodType.Delete,
			requestHeaders: {
				EXAMPLE_KEY_RqH0E :"EXAMPLE_VALUE_VyuXPExS4JDO0N6sgyf4"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_ccVEh :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 503,
						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.Get,
			requestHeaders: {
				EXAMPLE_KEY_m9aqN :"EXAMPLE_VALUE_6rTxuB2wxzH7EjSV9Wt1"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_RtkcJ :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 266,
						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.Get,
			requestHeaders: {
				EXAMPLE_KEY_FzyGH :"EXAMPLE_VALUE_rwujFuwpJW6yIf64RSbT"
				},
			configValues: {
				configParamValues: {
					EXAMPLE_KEY_NTuWT :{
						stringValue: "EXAMPLE-stringValue-Value",
						intValue: 92,
						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_nRQGl :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 894,
							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: 967,
				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: 119,
		identifier: "EXAMPLE-identifier-Value",
		inputPorts: [{
				modelType: "INPUT_PORT",				portType: dataintegration.models.InputPort.PortType.Data,
				fields: [{
						modelType: "INPUT_FIELD",						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: 209,
								configParameterDefinitions: {
									EXAMPLE_KEY_6rge8 :{
										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: 529,
							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_a5ECH :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 185,
									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: 935,
						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_yiw0M :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 290,
							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: 934,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		outputPorts: [{
				modelType: "OUTPUT_PORT",				portType: dataintegration.models.OutputPort.PortType.Data,
				fields: [{
						modelType: "SHAPE",						type: {
							modelType: "ARRAY_TYPE",							elementType: "EXAMPLE-elementType-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",
							objectStatus: 644,
							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_FDWRW :{
									stringValue: "EXAMPLE-stringValue-Value",
									intValue: 957,
									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: 123,
						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_3DtAO :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 438,
							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: 253,
				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: true,
				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_ik1wT :{
							stringValue: "EXAMPLE-stringValue-Value",
							intValue: 216,
							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: 489,
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value"

				}
				],
		opConfigValues: {
			configParamValues: {
				EXAMPLE_KEY_59ktf :{
					stringValue: "EXAMPLE-stringValue-Value",
					intValue: 721,
					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",

				}
,

			}
,
		configProviderDelegate: {
			bindings: {
				EXAMPLE_KEY_h4evk :{
					simpleValue: "EXAMPLE-simpleValue-Value",
					rootObjectValue: "EXAMPLE-rootObjectValue-Value",

					}

				},

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

			}


		}

	const createTaskRequest: dataintegration.requests.CreateTaskRequest = { 
	workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
	createTaskDetails: createTaskDetails,
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",
	opcRequestId: "6RKB0LTWISTVN9MNP79T<unique_ID>",

		}; 


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