// 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  createExternalPublicationDetails = {
		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: 548,

			}
,
		configurationDetails: {
			dataAsset: {
				modelType: "ORACLE_DATA_ASSET",				host: "EXAMPLE-host-Value",
				port: "EXAMPLE-port-Value",
				serviceName: "EXAMPLE-serviceName-Value",
				driverClass: "EXAMPLE-driverClass-Value",
				sid: "EXAMPLE-sid-Value",
				credentialFileContent: "EXAMPLE-credentialFileContent-Value",
				walletSecret: {
					secretConfig: {
						modelType: "OCI_VAULT_SECRET_CONFIG",						secretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"

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

					}
,
				walletPasswordSecret: {
					secretConfig: {
						modelType: "OCI_VAULT_SECRET_CONFIG",						secretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"

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

					}
,
				defaultConnection: {
					modelType: "ORACLEDB_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: 802,
					objectStatus: 180,
					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: 680,
						externalKey: "EXAMPLE-externalKey-Value",
						isHasContainers: false,
						defaultConnection: "EXAMPLE-defaultConnection-Value",
						objectStatus: 152,
						identifier: "EXAMPLE-identifier-Value",
						metadata: {
							createdBy: "EXAMPLE-createdBy-Value",
							createdByName: "EXAMPLE-createdByName-Value",
							updatedBy: "EXAMPLE-updatedBy-Value",
							updatedByName: "EXAMPLE-updatedByName-Value",
							timeCreated: new Date("Sat May 28 03:30:17 UTC 2039"),
							timeUpdated: new Date("Thu Mar 16 05:50:01 UTC 2000"),
							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_Bz4Me :"EXAMPLE_VALUE_lyeIcvdQww7NKb6R0qkL"
								},
							registryVersion: 904,
							labels: ["EXAMPLE--Value"									],
							isFavorite: true,
							countStatistics: {
								objectTypeCountList: [{
										objectType: dataintegration.models.CountStatisticSummary.ObjectType.Project,
										objectCount: 775,

										}
										],

								}
,

							}
,

						}
,
					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 Nov 04 14:10:54 UTC 2031"),
						timeUpdated: new Date("Thu Aug 23 22:48:10 UTC 2001"),
						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_1kgyu :"EXAMPLE_VALUE_c8YRaX70CB6RYnysiy8m"
							},
						registryVersion: 827,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.Task,
									objectCount: 552,

									}
									],

							}
,

						}


					}
,
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value",
				objectStatus: 283,
				identifier: "EXAMPLE-identifier-Value",
				externalKey: "EXAMPLE-externalKey-Value",
				assetProperties: {
					EXAMPLE_KEY_r7BYX :"EXAMPLE_VALUE_mcZxFiT0zBPpRvjkHTXw"
					},
				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: 236,
					typeMappingTo: {
						EXAMPLE_KEY_3Rj33 :"EXAMPLE_VALUE_VpdpEw2IKlHtcg2pjPqb"
						},
					typeMappingFrom: {
						EXAMPLE_KEY_pIo6O :"EXAMPLE_VALUE_xZl8slnPY9zciMqRDUER"
						},
					objectStatus: 814,
					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: false,
								objectStatus: 556,
								configParameterDefinitions: {
									EXAMPLE_KEY_i5gyb :{
										parameterName: "EXAMPLE-parameterName-Value",
										description: "EXAMPLE-description-Value",
										defaultValue: "EXAMPLE-defaultValue-Value",
										classFieldName: "EXAMPLE-classFieldName-Value",
										isStatic: true,
										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: 836,
							description: "EXAMPLE-description-Value"

							}
							],

					}
,
				objectVersion: 374,
				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("Fri Apr 08 01:13:40 UTC 2022"),
					timeUpdated: new Date("Sun May 26 16:43:14 UTC 2019"),
					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_EImGN :"EXAMPLE_VALUE_rWiWBSAUVd5tT1HhFVQw"
						},
					registryVersion: 262,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataFlow,
								objectCount: 585,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_zzOlW :"EXAMPLE_VALUE_VQRGMki9PmJKUZU2XYqR"
					}

				}
,
			connection: {
				modelType: "MYSQL_HEATWAVE_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: 267,
				objectStatus: 850,
				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: 154,
					externalKey: "EXAMPLE-externalKey-Value",
					isHasContainers: true,
					defaultConnection: "EXAMPLE-defaultConnection-Value",
					objectStatus: 531,
					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 Jan 28 11:06:26 UTC 2046"),
						timeUpdated: new Date("Thu Jul 16 02:25:54 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_4zmd2 :"EXAMPLE_VALUE_3JBTHtBus9nfAfH1SUil"
							},
						registryVersion: 86,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.Application,
									objectCount: 744,

									}
									],

							}
,

						}
,

					}
,
				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("Sun May 05 10:28:15 UTC 2019"),
					timeUpdated: new Date("Thu May 02 20:52:54 UTC 2002"),
					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_vYt3b :"EXAMPLE_VALUE_flb50yI5LVk2YT2KP33O"
						},
					registryVersion: 336,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Application,
								objectCount: 281,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_efbkM :"EXAMPLE_VALUE_kJ3Sqm7bcqHaHAiTmcZ5"
					}

				}
,
			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: 473,
				externalKey: "EXAMPLE-externalKey-Value",
				isHasContainers: false,
				defaultConnection: "EXAMPLE-defaultConnection-Value",
				objectStatus: 899,
				identifier: "EXAMPLE-identifier-Value",
				metadata: {
					createdBy: "EXAMPLE-createdBy-Value",
					createdByName: "EXAMPLE-createdByName-Value",
					updatedBy: "EXAMPLE-updatedBy-Value",
					updatedByName: "EXAMPLE-updatedByName-Value",
					timeCreated: new Date("Sat Aug 21 22:59:20 UTC 2049"),
					timeUpdated: new Date("Mon Apr 26 19:25:37 UTC 2021"),
					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_B7WRB :"EXAMPLE_VALUE_2zS5jh3ThXm9leeIG9k9"
						},
					registryVersion: 384,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataAsset,
								objectCount: 636,

								}
								],

						}
,

					}
,

				}
,

			}
,

		}

	const createExternalPublicationRequest: dataintegration.requests.CreateExternalPublicationRequest = { 
	workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
	taskKey: "EXAMPLE-taskKey-Value",
	createExternalPublicationDetails: createExternalPublicationDetails,
	opcRequestId: "OBPEOWZNWMH3IEBR1BS3<unique_ID>",
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


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