# 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(
                "2048-02-14T09:54:18.998Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_updated=datetime.strptime(
                "2012-05-22T13:36:39.653Z",
                "%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="TEXT",
                    namespace_name="EXAMPLE-namespaceName-Value",
                    namespace_key="EXAMPLE-namespaceKey-Value",
                    is_multi_valued=True,
                    is_hidden=False,
                    is_editable=True,
                    is_shown_in_list=False,
                    is_event_enabled=True,
                    is_list_type=True,
                    allowed_values=["EXAMPLE--Value"])],
            properties={
                'EXAMPLE_KEY_C0Wwy': {
                    'EXAMPLE_KEY_gBy2Y': 'EXAMPLE--Value'}},
            external_key="EXAMPLE-externalKey-Value",
            time_status_updated=datetime.strptime(
                "2043-06-20T05:48:36.381Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            lifecycle_state="FAILED",
            is_default=False,
            data_asset_key="EXAMPLE-dataAssetKey-Value",
            type_key="EXAMPLE-typeKey-Value",
            uri="EXAMPLE-uri-Value"),
        connection_payload="FA6qYlbdB6fc75aB8c1Q",
        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="BLKRQLFBQNEAGQOAKCFT<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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