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

			}
,
		configurationDetails: {
			dataAsset: {
				modelType: "ORACLE_SIEBEL_DATA_ASSET",				host: "EXAMPLE-host-Value",
				port: "EXAMPLE-port-Value",
				serviceName: "EXAMPLE-serviceName-Value",
				driverClass: "EXAMPLE-driverClass-Value",
				sid: "EXAMPLE-sid-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: "ORACLE_SIEBEL_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: 438,
					objectStatus: 149,
					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: 645,
						externalKey: "EXAMPLE-externalKey-Value",
						isHasContainers: false,
						defaultConnection: "EXAMPLE-defaultConnection-Value",
						objectStatus: 921,
						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 Jul 26 22:24:44 UTC 2002"),
							timeUpdated: new Date("Wed Sep 19 22:24:39 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_3djCk :"EXAMPLE_VALUE_FYukpvfXLz0TU14MfXBa"
								},
							registryVersion: 698,
							labels: ["EXAMPLE--Value"									],
							isFavorite: true,
							countStatistics: {
								objectTypeCountList: [{
										objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataAsset,
										objectCount: 683,

										}
										],

								}
,

							}
,

						}
,
					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("Sat Apr 27 00:51:59 UTC 2013"),
						timeUpdated: new Date("Wed Dec 13 05:39:35 UTC 2034"),
						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_W94bW :"EXAMPLE_VALUE_82JG5aj2qM9WfPGOn1H3"
							},
						registryVersion: 244,
						labels: ["EXAMPLE--Value"								],
						isFavorite: false,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.Folder,
									objectCount: 655,

									}
									],

							}
,

						}


					}
,
				key: "EXAMPLE-key-Value",
				modelVersion: "EXAMPLE-modelVersion-Value",
				name: "EXAMPLE-name-Value",
				description: "EXAMPLE-description-Value",
				objectStatus: 821,
				identifier: "EXAMPLE-identifier-Value",
				externalKey: "EXAMPLE-externalKey-Value",
				assetProperties: {
					EXAMPLE_KEY_i47OK :"EXAMPLE_VALUE_oidR6CTJKX9p4OfW9Wjt"
					},
				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: 700,
					typeMappingTo: {
						EXAMPLE_KEY_p0OSL :"EXAMPLE_VALUE_6Cow1KmedpFGE3kOIRdw"
						},
					typeMappingFrom: {
						EXAMPLE_KEY_F6j07 :"EXAMPLE_VALUE_w1Z4W6T9cMYUhtV4z3Ge"
						},
					objectStatus: 564,
					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: true,
								objectStatus: 416,
								configParameterDefinitions: {
									EXAMPLE_KEY_pyNYM :{
										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: 874,
											description: "EXAMPLE-description-Value"

											}
,
										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: 649,
							description: "EXAMPLE-description-Value"

							}
							],

					}
,
				objectVersion: 702,
				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 Dec 08 04:39:55 UTC 2006"),
					timeUpdated: new Date("Wed Sep 01 16:18:39 UTC 2032"),
					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_u4Iy2 :"EXAMPLE_VALUE_5GnJGYWEzDupNzEqY5Tl"
						},
					registryVersion: 950,
					labels: ["EXAMPLE--Value"							],
					isFavorite: false,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataAsset,
								objectCount: 608,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_aHNlX :"EXAMPLE_VALUE_EzJrKSLGwQQQE7NG3z4c"
					}

				}
,
			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: 869,
				objectStatus: 266,
				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: 86,
					externalKey: "EXAMPLE-externalKey-Value",
					isHasContainers: true,
					defaultConnection: "EXAMPLE-defaultConnection-Value",
					objectStatus: 285,
					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 Jan 02 14:47:19 UTC 2001"),
						timeUpdated: new Date("Mon Feb 10 05:25:28 UTC 2003"),
						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_zXHKl :"EXAMPLE_VALUE_i6mVfJw1H5xmLq8vNIjl"
							},
						registryVersion: 726,
						labels: ["EXAMPLE--Value"								],
						isFavorite: true,
						countStatistics: {
							objectTypeCountList: [{
									objectType: dataintegration.models.CountStatisticSummary.ObjectType.Task,
									objectCount: 177,

									}
									],

							}
,

						}
,

					}
,
				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("Fri May 06 22:28:49 UTC 2011"),
					timeUpdated: new Date("Tue Sep 10 06:40:44 UTC 2024"),
					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_FcOor :"EXAMPLE_VALUE_GmZYgA0rxld6HLDllYXT"
						},
					registryVersion: 225,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.DataAsset,
								objectCount: 323,

								}
								],

						}
,

					}
,
				keyMap: {
					EXAMPLE_KEY_okWmJ :"EXAMPLE_VALUE_MA2DIKJOvYdt6G8JmgxM"
					}

				}
,
			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: 237,
				externalKey: "EXAMPLE-externalKey-Value",
				isHasContainers: true,
				defaultConnection: "EXAMPLE-defaultConnection-Value",
				objectStatus: 561,
				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 Jun 27 10:00:42 UTC 2042"),
					timeUpdated: new Date("Fri Apr 16 17:29:28 UTC 2032"),
					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_p6W1f :"EXAMPLE_VALUE_cf9wqzvCjXPU1AeS1Pvu"
						},
					registryVersion: 153,
					labels: ["EXAMPLE--Value"							],
					isFavorite: true,
					countStatistics: {
						objectTypeCountList: [{
								objectType: dataintegration.models.CountStatisticSummary.ObjectType.Application,
								objectCount: 500,

								}
								],

						}
,

					}
,

				}
,

			}
,

		}

	const createExternalPublicationRequest: dataintegration.requests.CreateExternalPublicationRequest = { 
	workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
	taskKey: "EXAMPLE-taskKey-Value",
	createExternalPublicationDetails: createExternalPublicationDetails,
	opcRequestId: "ZFWXMGOPQUYE2PCTDTOX<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);
     }
})();