// 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  updateExternalPublicationDetails = {
		applicationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value",
		applicationCompartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value",
		displayName: "EXAMPLE-displayName-Value",
		description: "EXAMPLE-description-Value",
		resourceConfiguration: {
			sparkVersion: "EXAMPLE-sparkVersion-Value",
			driverShape: "EXAMPLE-driverShape-Value",
			executorShape: "EXAMPLE-executorShape-Value",
			totalExecutors: 84,

			}
,
		configurationDetails: {
			dataAsset: {
				modelType: "HDFS_DATA_ASSET",				host: "EXAMPLE-host-Value",
				port: "EXAMPLE-port-Value",
				protocol: "EXAMPLE-protocol-Value",
				validateCertificate: true,
				defaultConnection: {
					modelType: "HDFS_CONNECTION",					hdfsPrincipal: "EXAMPLE-hdfsPrincipal-Value",
					dataNodePrincipal: "EXAMPLE-dataNodePrincipal-Value",
					nameNodePrincipal: "EXAMPLE-nameNodePrincipal-Value",
					realm: "EXAMPLE-realm-Value",
					keyDistributionCenter: "EXAMPLE-keyDistributionCenter-Value",
					keyTabContent: {
						secretConfig: {
							modelType: "OCI_VAULT_SECRET_CONFIG",							secretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"

							}
,
						value: "EXAMPLE-value-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",
					objectVersion: 225,
					objectStatus: 331,
					identifier: "EXAMPLE-identifier-Value",
					primarySchema: {
						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",
						resourceName: "EXAMPLE-resourceName-Value",
						description: "EXAMPLE-description-Value",
						objectVersion: 364,
						externalKey: "EXAMPLE-externalKey-Value",
						isHasContainers: false,
						defaultConnection: "EXAMPLE-defaultConnection-Value",
						objectStatus: 962,
						identifier: "EXAMPLE-identifier-Value",
						metadata: {
							createdBy: "EXAMPLE-createdBy-Value",
							createdByName: "EXAMPLE-createdByName-Value",
							updatedBy: "EXAMPLE-updatedBy-Value",
							updatedByName: "EXAMPLE-updatedByName-Value",
							timeCreated: new Date("Sun Oct 02 20:35:26 UTC 2039"),
							timeUpdated: new Date("Wed Jul 16 14:25:24 UTC 2014"),
							aggregatorKey: "EXAMPLE-aggregatorKey-Value",
							aggregator: {
								type: "EXAMPLE-type-Value",
								key: "EXAMPLE-key-Value",
								name: "EXAMPLE-name-Value",
								identifier: "EXAMPLE-identifier-Value",
								description: "EXAMPLE-description-Value",

								}
,
							identifierPath: "EXAMPLE-identifierPath-Value",
							infoFields: {
								EXAMPLE_KEY_2CMNn :"EXAMPLE_VALUE_459ktf2xn5IuCW4XsKfX"
								},
							registryVersion: 714,
							labels: ["EXAMPLE--Value"									],
							isFavorite: true,
							countStatistics: {
								objectTypeCountList: [{
										objectType: dataintegration.models.CountStatisticSummary.ObjectType.Folder,
										objectCount: 530,

										}
										],

								}
,

							}
,

						}
,
					connectionProperties: [{
							name: "EXAMPLE-name-Value",
							value: "EXAMPLE-value-Value",

							}
							],
					isDefault: true,
					metadata: {
						createdBy: "EXAMPLE-createdBy-Value",
						createdByName: "EXAMPLE-createdByName-Value",
						updatedBy: "EXAMPLE-updatedBy-Value",
						updatedByName: "EXAMPLE-updatedByName-Value",
						timeCreated: new Date("Fri Nov 29 15:42:44 UTC 2041"),
						timeUpdated: new Date("Wed Apr 19 14:54:21 UTC 2017"),
						aggregatorKey: "EXAMPLE-aggregatorKey-Value",
						aggregator: {
							type: "EXAMPLE-type-Value",
							key: "EXAMPLE-key-Value",
							name: "EXAMPLE-name-Value",
							identifier: "EXAMPLE-identifier-Value",
							description: "EXAMPLE-description-Value",

							}
,
						identifierPath: "EXAMPLE-identifierPath-Value",
						infoFields: {
							EXAMPLE_KEY_RT0JW :"EXAMPLE_VALUE_4TTphh4evkgyh1ZVHmS8"
							},
						registryVersion: 764,
						labels: ["EXAMPLE--Value"								],
						isFavorite: false,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.UserDefinedFunction,
									objectCount: 715,

									}
									],

							}
,

						}


					}
,
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value",
				objectStatus: 364,
				identifier: "EXAMPLE-identifier-Value",
				externalKey: "EXAMPLE-externalKey-Value",
				assetProperties: {
					EXAMPLE_KEY_zJhML :"EXAMPLE_VALUE_hI45gJaojQ5hKjb5yGj9"
					},
				nativeTypeSystem: {
					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",
					description: "EXAMPLE-description-Value",
					objectVersion: 807,
					typeMappingTo: {
						EXAMPLE_KEY_EDX6c :"EXAMPLE_VALUE_djTp9iZLw6uGss5fU2Nv"
						},
					typeMappingFrom: {
						EXAMPLE_KEY_3woTf :"EXAMPLE_VALUE_xvICCsyf07SsFDffd1CS"
						},
					objectStatus: 948,
					identifier: "EXAMPLE-identifier-Value",
					types: [{
							modelType: "DATA_TYPE",							dtType: dataintegration.models.DataType.DtType.Primitive,
							typeSystemName: "EXAMPLE-typeSystemName-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: 370,
								configParameterDefinitions: {
									EXAMPLE_KEY_qQc3B :{
										parameterType: {
											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: 349,
											description: "EXAMPLE-description-Value"

											}
,
										parameterName: "EXAMPLE-parameterName-Value",
										description: "EXAMPLE-description-Value",
										defaultValue: "EXAMPLE-defaultValue-Value",
										classFieldName: "EXAMPLE-classFieldName-Value",
										isStatic: false,
										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: 656,
							description: "EXAMPLE-description-Value"

							}
							],

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

					}
,
				metadata: {
					createdBy: "EXAMPLE-createdBy-Value",
					createdByName: "EXAMPLE-createdByName-Value",
					updatedBy: "EXAMPLE-updatedBy-Value",
					updatedByName: "EXAMPLE-updatedByName-Value",
					timeCreated: new Date("Mon Apr 15 20:25:54 UTC 2019"),
					timeUpdated: new Date("Sun Sep 01 09:41:36 UTC 2041"),
					aggregatorKey: "EXAMPLE-aggregatorKey-Value",
					aggregator: {
						type: "EXAMPLE-type-Value",
						key: "EXAMPLE-key-Value",
						name: "EXAMPLE-name-Value",
						identifier: "EXAMPLE-identifier-Value",
						description: "EXAMPLE-description-Value",

						}
,
					identifierPath: "EXAMPLE-identifierPath-Value",
					infoFields: {
						EXAMPLE_KEY_mktHm :"EXAMPLE_VALUE_ultOfqzhepqtW59RcFRq"
						},
					registryVersion: 769,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Task,
								objectCount: 575,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_XPExS :"EXAMPLE_VALUE_4JDO0N6sgyf49GoTPlsN"
					}

				}
,
			connection: {
				modelType: "HDFS_CONNECTION",				hdfsPrincipal: "EXAMPLE-hdfsPrincipal-Value",
				dataNodePrincipal: "EXAMPLE-dataNodePrincipal-Value",
				nameNodePrincipal: "EXAMPLE-nameNodePrincipal-Value",
				realm: "EXAMPLE-realm-Value",
				keyDistributionCenter: "EXAMPLE-keyDistributionCenter-Value",
				keyTabContent: {
					secretConfig: {
						modelType: "OCI_VAULT_SECRET_CONFIG",						secretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"

						}
,
					value: "EXAMPLE-value-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",
				objectVersion: 351,
				objectStatus: 409,
				identifier: "EXAMPLE-identifier-Value",
				primarySchema: {
					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",
					resourceName: "EXAMPLE-resourceName-Value",
					description: "EXAMPLE-description-Value",
					objectVersion: 448,
					externalKey: "EXAMPLE-externalKey-Value",
					isHasContainers: true,
					defaultConnection: "EXAMPLE-defaultConnection-Value",
					objectStatus: 901,
					identifier: "EXAMPLE-identifier-Value",
					metadata: {
						createdBy: "EXAMPLE-createdBy-Value",
						createdByName: "EXAMPLE-createdByName-Value",
						updatedBy: "EXAMPLE-updatedBy-Value",
						updatedByName: "EXAMPLE-updatedByName-Value",
						timeCreated: new Date("Wed Dec 08 06:37:12 UTC 2038"),
						timeUpdated: new Date("Mon Jul 16 20:13:48 UTC 2040"),
						aggregatorKey: "EXAMPLE-aggregatorKey-Value",
						aggregator: {
							type: "EXAMPLE-type-Value",
							key: "EXAMPLE-key-Value",
							name: "EXAMPLE-name-Value",
							identifier: "EXAMPLE-identifier-Value",
							description: "EXAMPLE-description-Value",

							}
,
						identifierPath: "EXAMPLE-identifierPath-Value",
						infoFields: {
							EXAMPLE_KEY_HhU9y :"EXAMPLE_VALUE_oVhJR2lEIPr5FLicYTUm"
							},
						registryVersion: 577,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.FunctionLibrary,
									objectCount: 474,

									}
									],

							}
,

						}
,

					}
,
				connectionProperties: [{
						name: "EXAMPLE-name-Value",
						value: "EXAMPLE-value-Value",

						}
						],
				isDefault: true,
				metadata: {
					createdBy: "EXAMPLE-createdBy-Value",
					createdByName: "EXAMPLE-createdByName-Value",
					updatedBy: "EXAMPLE-updatedBy-Value",
					updatedByName: "EXAMPLE-updatedByName-Value",
					timeCreated: new Date("Tue Mar 25 23:35:59 UTC 2031"),
					timeUpdated: new Date("Sat Feb 22 11:29:26 UTC 2025"),
					aggregatorKey: "EXAMPLE-aggregatorKey-Value",
					aggregator: {
						type: "EXAMPLE-type-Value",
						key: "EXAMPLE-key-Value",
						name: "EXAMPLE-name-Value",
						identifier: "EXAMPLE-identifier-Value",
						description: "EXAMPLE-description-Value",

						}
,
					identifierPath: "EXAMPLE-identifierPath-Value",
					infoFields: {
						EXAMPLE_KEY_Jm9aq :"EXAMPLE_VALUE_N6rTxuB2wxzH7EjSV9Wt"
						},
					registryVersion: 987,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Folder,
								objectCount: 118,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_Zcvt8 :"EXAMPLE_VALUE_Iqs9uvHKOAIXklxEUxKu"
					}

				}
,
			compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
			schema: {
				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",
				resourceName: "EXAMPLE-resourceName-Value",
				description: "EXAMPLE-description-Value",
				objectVersion: 725,
				externalKey: "EXAMPLE-externalKey-Value",
				isHasContainers: true,
				defaultConnection: "EXAMPLE-defaultConnection-Value",
				objectStatus: 491,
				identifier: "EXAMPLE-identifier-Value",
				metadata: {
					createdBy: "EXAMPLE-createdBy-Value",
					createdByName: "EXAMPLE-createdByName-Value",
					updatedBy: "EXAMPLE-updatedBy-Value",
					updatedByName: "EXAMPLE-updatedByName-Value",
					timeCreated: new Date("Fri Aug 30 12:25:14 UTC 2047"),
					timeUpdated: new Date("Tue May 21 08:15:48 UTC 2030"),
					aggregatorKey: "EXAMPLE-aggregatorKey-Value",
					aggregator: {
						type: "EXAMPLE-type-Value",
						key: "EXAMPLE-key-Value",
						name: "EXAMPLE-name-Value",
						identifier: "EXAMPLE-identifier-Value",
						description: "EXAMPLE-description-Value",

						}
,
					identifierPath: "EXAMPLE-identifierPath-Value",
					infoFields: {
						EXAMPLE_KEY_exRBP :"EXAMPLE_VALUE_gUSNVc2BpqgvQRtkcJaF"
						},
					registryVersion: 709,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Application,
								objectCount: 467,

								}
								],

						}
,

					}
,

				}
,

			}
,

		}

	const updateExternalPublicationRequest: dataintegration.requests.UpdateExternalPublicationRequest = { 
	workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
	taskKey: "EXAMPLE-taskKey-Value",
	externalPublicationsKey: "EXAMPLE-externalPublicationsKey-Value",
	updateExternalPublicationDetails: updateExternalPublicationDetails,
	opcRequestId: "UJFUWPJW6YIF64RSBTML<unique_ID>",
	ifMatch: "EXAMPLE-ifMatch-Value",

		}; 


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