// 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 datacatalog from "oci-datacatalog";
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 datacatalog.DataCatalogClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  parseConnectionDetails = {
		connectionDetail: {
			key: "EXAMPLE-key-Value",
			description: "EXAMPLE-description-Value",
			displayName: "EXAMPLE-displayName-Value",
			timeCreated: new Date("Thu Aug 18 09:44:54 UTC 2039"),
			timeUpdated: new Date("Mon Aug 13 03:19:07 UTC 2046"),
			createdById: "ocid1.test.oc1..<unique_ID>EXAMPLE-createdById-Value",
			updatedById: "ocid1.test.oc1..<unique_ID>EXAMPLE-updatedById-Value",
			customPropertyMembers: [{
					key: "EXAMPLE-key-Value",
					displayName: "EXAMPLE-displayName-Value",
					description: "EXAMPLE-description-Value",
					value: "EXAMPLE-value-Value",
					dataType: datacatalog.models.CustomPropertyDataType.Number,
					namespaceName: "EXAMPLE-namespaceName-Value",
					namespaceKey: "EXAMPLE-namespaceKey-Value",
					isMultiValued: true,
					isHidden: true,
					isEditable: false,
					isShownInList: true,
					isEventEnabled: false,
					isListType: false,
					allowedValues: ["EXAMPLE--Value"							],

					}
					],
			properties: {
				EXAMPLE_KEY_tAZLo :{
					EXAMPLE_KEY_YmBpy :"EXAMPLE--Value"
					}
				},
			externalKey: "EXAMPLE-externalKey-Value",
			timeStatusUpdated: new Date("Sat Sep 19 11:52:29 UTC 2037"),
			lifecycleState: datacatalog.models.LifecycleState.Moving,
			isDefault: false,
			dataAssetKey: "EXAMPLE-dataAssetKey-Value",
			typeKey: "EXAMPLE-typeKey-Value",
			uri: "EXAMPLE-uri-Value",

			}
,
		connectionPayload: "some Byte data",
		walletSecretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-walletSecretId-Value",
		walletSecretName: "EXAMPLE-walletSecretName-Value",

		}

	const parseConnectionRequest: datacatalog.requests.ParseConnectionRequest = { 
	catalogId: "ocid1.test.oc1..<unique_ID>EXAMPLE-catalogId-Value",
	dataAssetKey: "EXAMPLE-dataAssetKey-Value",
	parseConnectionDetails: parseConnectionDetails,
	connectionKey: "EXAMPLE-connectionKey-Value",
	opcRequestId: "C91ZTR0UPUD5H5WHNFUD<unique_ID>",
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


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