# 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).

from datetime import datetime
import oci

# 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(
                "2031-05-20T22:35:53.298Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_updated=datetime.strptime(
                "2028-05-21T03:38:37.874Z",
                "%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="NUMBER",
                    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=False,
                    is_list_type=False,
                    allowed_values=["EXAMPLE--Value"])],
            properties={
                'EXAMPLE_KEY_AcMJy': {
                    'EXAMPLE_KEY_pcgK2': 'EXAMPLE--Value'}},
            external_key="EXAMPLE-externalKey-Value",
            time_status_updated=datetime.strptime(
                "2004-05-05T16:59:32.839Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            lifecycle_state="FAILED",
            is_default=True,
            data_asset_key="EXAMPLE-dataAssetKey-Value",
            type_key="EXAMPLE-typeKey-Value",
            uri="EXAMPLE-uri-Value"),
        connection_payload="CQAPKQxy5WQmeSTLOlAl",
        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="KP3LOV5USCQFYDZVCH2X<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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