# 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 oci
from datetime import datetime

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
data_catalog_client = oci.data_catalog.DataCatalogClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
parse_connection_response = data_catalog_client.parse_connection(
    catalog_id="ocid1.test.oc1..<unique_ID>EXAMPLE-catalogId-Value",
    data_asset_key="EXAMPLE-dataAssetKey-Value",
    parse_connection_details=oci.data_catalog.models.ParseConnectionDetails(
        connection_detail=oci.data_catalog.models.Connection(
            key="EXAMPLE-key-Value",
            description="EXAMPLE-description-Value",
            display_name="EXAMPLE-displayName-Value",
            time_created=datetime.strptime(
                "2020-11-29T21:01:58.272Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_updated=datetime.strptime(
                "2017-02-20T09:24:28.772Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            created_by_id="ocid1.test.oc1..<unique_ID>EXAMPLE-createdById-Value",
            updated_by_id="ocid1.test.oc1..<unique_ID>EXAMPLE-updatedById-Value",
            custom_property_members=[
                oci.data_catalog.models.CustomPropertyGetUsage(
                    key="EXAMPLE-key-Value",
                    display_name="EXAMPLE-displayName-Value",
                    description="EXAMPLE-description-Value",
                    value="EXAMPLE-value-Value",
                    data_type="BOOLEAN",
                    namespace_name="EXAMPLE-namespaceName-Value",
                    namespace_key="EXAMPLE-namespaceKey-Value",
                    is_multi_valued=True,
                    is_hidden=True,
                    is_editable=True,
                    is_shown_in_list=False,
                    is_event_enabled=True,
                    is_list_type=False,
                    allowed_values=["EXAMPLE--Value"])],
            properties={
                'EXAMPLE_KEY_lDbGc': {
                    'EXAMPLE_KEY_vWxi4': 'EXAMPLE--Value'}},
            external_key="EXAMPLE-externalKey-Value",
            time_status_updated=datetime.strptime(
                "2036-05-18T06:20:31.852Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            lifecycle_state="UPDATING",
            is_default=False,
            data_asset_key="EXAMPLE-dataAssetKey-Value",
            type_key="EXAMPLE-typeKey-Value",
            uri="EXAMPLE-uri-Value"),
        connection_payload="2kgpZl6lP6oh4Jp6bBZ7",
        wallet_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletSecretId-Value",
        wallet_secret_name="EXAMPLE-walletSecretName-Value"),
    connection_key="EXAMPLE-connectionKey-Value",
    opc_request_id="ZPYIGK1OZKV7ZXAH5L59<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(parse_connection_response.data)