// 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: 995,

			}
,
		configurationDetails: {
			dataAsset: {
				modelType: "REST_DATA_ASSET",				baseUrl: "EXAMPLE-baseUrl-Value",
				manifestFileContent: "EXAMPLE-manifestFileContent-Value",
				defaultConnection: {
					modelType: "ORACLE_EBS_CONNECTION",					username: "EXAMPLE-username-Value",
					password: "EXAMPLE-password-Value",
					passwordSecret: {
						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: 395,
					objectStatus: 459,
					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: 121,
						externalKey: "EXAMPLE-externalKey-Value",
						isHasContainers: false,
						defaultConnection: "EXAMPLE-defaultConnection-Value",
						objectStatus: 94,
						identifier: "EXAMPLE-identifier-Value",
						metadata: {
							createdBy: "EXAMPLE-createdBy-Value",
							createdByName: "EXAMPLE-createdByName-Value",
							updatedBy: "EXAMPLE-updatedBy-Value",
							updatedByName: "EXAMPLE-updatedByName-Value",
							timeCreated: new Date("Tue Nov 11 22:09:31 UTC 2014"),
							timeUpdated: new Date("Sat Nov 08 17:49:28 UTC 2031"),
							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_tbZOE :"EXAMPLE_VALUE_FXeqbAfpFX1tMXaYi7Yc"
								},
							registryVersion: 803,
							labels: ["EXAMPLE--Value"									],
							isFavorite: true,
							countStatistics: {
								objectTypeCountList: [{
										objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataFlow,
										objectCount: 181,

										}
										],

								}
,

							}
,

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

							}
							],
					isDefault: false,
					metadata: {
						createdBy: "EXAMPLE-createdBy-Value",
						createdByName: "EXAMPLE-createdByName-Value",
						updatedBy: "EXAMPLE-updatedBy-Value",
						updatedByName: "EXAMPLE-updatedByName-Value",
						timeCreated: new Date("Mon Apr 08 14:16:05 UTC 2019"),
						timeUpdated: new Date("Thu Jan 29 21:01:52 UTC 2015"),
						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_hCMi0 :"EXAMPLE_VALUE_QQ3xTjlCveOnmtPU96VI"
							},
						registryVersion: 611,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.UserDefinedFunction,
									objectCount: 337,

									}
									],

							}
,

						}


					}
,
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value",
				objectStatus: 897,
				identifier: "EXAMPLE-identifier-Value",
				externalKey: "EXAMPLE-externalKey-Value",
				assetProperties: {
					EXAMPLE_KEY_04Dyp :"EXAMPLE_VALUE_7aEMslSI2xIcl3qpuDsB"
					},
				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: 893,
					typeMappingTo: {
						EXAMPLE_KEY_sx7iP :"EXAMPLE_VALUE_CgRqKEEpQQWeC2BJafiC"
						},
					typeMappingFrom: {
						EXAMPLE_KEY_1eSf1 :"EXAMPLE_VALUE_P4xiYLk6RLB6h9bzMkC7"
						},
					objectStatus: 422,
					identifier: "EXAMPLE-identifier-Value",
					types: [{
							modelType: "DATA_TYPE",							dtType: dataintegration.models.DataType.DtType.Structured,
							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: true,
								objectStatus: 637,
								configParameterDefinitions: {
									EXAMPLE_KEY_tIbea :{
										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: 446,
											description: "EXAMPLE-description-Value"

											}
,
										parameterName: "EXAMPLE-parameterName-Value",
										description: "EXAMPLE-description-Value",
										defaultValue: "EXAMPLE-defaultValue-Value",
										classFieldName: "EXAMPLE-classFieldName-Value",
										isStatic: false,
										isClassFieldValue: true,

										}

									},

								}
,
							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: 685,
							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("Tue May 02 10:22:11 UTC 2045"),
					timeUpdated: new Date("Fri Mar 06 13:35:09 UTC 2043"),
					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_xBHTj :"EXAMPLE_VALUE_tmIyS59N0jZHQo1HgA4I"
						},
					registryVersion: 988,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Task,
								objectCount: 949,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_bnEZr :"EXAMPLE_VALUE_EVsiqUZjDb9NbOSQMVlo"
					}

				}
,
			connection: {
				modelType: "OAUTH2_CONNECTION",				accessTokenUrl: "EXAMPLE-accessTokenUrl-Value",
				clientId: "ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value",
				clientSecret: {
					secretConfig: {
						modelType: "OCI_VAULT_SECRET_CONFIG",						secretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"

						}
,
					value: "EXAMPLE-value-Value",

					}
,
				scope: "EXAMPLE-scope-Value",
				grantType: dataintegration.models.ConnectionFromOAuth2.GrantType.ClientCredentials,
				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: 320,
				objectStatus: 415,
				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: 253,
					externalKey: "EXAMPLE-externalKey-Value",
					isHasContainers: false,
					defaultConnection: "EXAMPLE-defaultConnection-Value",
					objectStatus: 335,
					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 Dec 28 07:27:47 UTC 2012"),
						timeUpdated: new Date("Fri Jun 14 01:42:57 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_nWwR6 :"EXAMPLE_VALUE_OG6alF2DXC0YHpA7KwYt"
							},
						registryVersion: 586,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.Folder,
									objectCount: 193,

									}
									],

							}
,

						}
,

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

						}
						],
				isDefault: false,
				metadata: {
					createdBy: "EXAMPLE-createdBy-Value",
					createdByName: "EXAMPLE-createdByName-Value",
					updatedBy: "EXAMPLE-updatedBy-Value",
					updatedByName: "EXAMPLE-updatedByName-Value",
					timeCreated: new Date("Sat Dec 30 11:02:22 UTC 2045"),
					timeUpdated: new Date("Tue Sep 18 12:40:09 UTC 2029"),
					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_TYb1L :"EXAMPLE_VALUE_xyWdGmyyTcCfM4bQzbRk"
						},
					registryVersion: 24,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Project,
								objectCount: 314,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_b2jAq :"EXAMPLE_VALUE_LmjGNGtwKWvnfp6qGeHX"
					}

				}
,
			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: 438,
				externalKey: "EXAMPLE-externalKey-Value",
				isHasContainers: true,
				defaultConnection: "EXAMPLE-defaultConnection-Value",
				objectStatus: 270,
				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 Oct 04 06:09:24 UTC 2000"),
					timeUpdated: new Date("Fri Jan 03 08:43:28 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_RqA2j :"EXAMPLE_VALUE_Lc4UHfjf8JrdzQ4joEbN"
						},
					registryVersion: 975,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.FunctionLibrary,
								objectCount: 886,

								}
								],

						}
,

					}
,

				}
,

			}
,

		}

	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: "UIB3ODDUYJTQXUFGAZEZ<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);
     }
})();