# 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_connectivity_client = oci.data_connectivity.DataConnectivityManagementClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_connection_response = data_connectivity_client.update_connection(
    registry_id="ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value",
    connection_key="EXAMPLE-connectionKey-Value",
    update_connection_details=oci.data_connectivity.models.UpdateConnectionDetails(
        properties={
            'EXAMPLE_KEY_XLjDp': 'EXAMPLE--Value'},
        type="EXAMPLE-type-Value",
        model_version="EXAMPLE-modelVersion-Value",
        model_type="EXAMPLE-modelType-Value",
        name="EXAMPLE-name-Value",
        description="EXAMPLE-description-Value",
        object_version=188,
        object_status=720,
        identifier="EXAMPLE-identifier-Value",
        primary_schema=oci.data_connectivity.models.Schema(
            key="EXAMPLE-key-Value",
            model_type="EXAMPLE-modelType-Value",
            name="EXAMPLE-name-Value",
            identifier="EXAMPLE-identifier-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_connectivity.models.ParentReference(
                    parent="EXAMPLE-parent-Value"),
            resource_name="EXAMPLE-resourceName-Value",
            description="EXAMPLE-description-Value",
            object_version=314,
            external_key="EXAMPLE-externalKey-Value",
            is_has_containers=True,
            default_connection="EXAMPLE-defaultConnection-Value",
            object_status=310,
            metadata=oci.data_connectivity.models.ObjectMetadata(
                        created_by="EXAMPLE-createdBy-Value",
                        created_by_name="EXAMPLE-createdByName-Value",
                        updated_by="EXAMPLE-updatedBy-Value",
                        updated_by_name="EXAMPLE-updatedByName-Value",
                        time_created=datetime.strptime(
                            "2045-07-15T11:59:33.236Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                time_updated=datetime.strptime(
                            "2009-03-29T17:50:01.649Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                aggregator_key="EXAMPLE-aggregatorKey-Value",
                aggregator=oci.data_connectivity.models.AggregatorSummary(
                            type="EXAMPLE-type-Value",
                            key="EXAMPLE-key-Value",
                            name="EXAMPLE-name-Value",
                            identifier="EXAMPLE-identifier-Value",
                            description="EXAMPLE-description-Value"),
                identifier_path="EXAMPLE-identifierPath-Value",
                info_fields={
                            'EXAMPLE_KEY_aB5fA': 'EXAMPLE_VALUE_E2NEYObK5ic3l09aHsTz'},
                registry_version=180,
                labels=["EXAMPLE--Value"],
                is_favorite=True)),
        connection_properties=[
            oci.data_connectivity.models.ConnectionProperty(
                name="EXAMPLE-name-Value",
                value="EXAMPLE-value-Value")],
        is_default=False,
        metadata=oci.data_connectivity.models.ObjectMetadata(
            created_by="EXAMPLE-createdBy-Value",
            created_by_name="EXAMPLE-createdByName-Value",
            updated_by="EXAMPLE-updatedBy-Value",
            updated_by_name="EXAMPLE-updatedByName-Value",
            time_created=datetime.strptime(
                "2022-04-01T01:01:17.828Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_updated=datetime.strptime(
                "2000-03-11T00:36:11.986Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            aggregator_key="EXAMPLE-aggregatorKey-Value",
            aggregator=oci.data_connectivity.models.AggregatorSummary(
                type="EXAMPLE-type-Value",
                key="EXAMPLE-key-Value",
                name="EXAMPLE-name-Value",
                identifier="EXAMPLE-identifier-Value",
                description="EXAMPLE-description-Value"),
            identifier_path="EXAMPLE-identifierPath-Value",
            info_fields={
                'EXAMPLE_KEY_OBMIp': 'EXAMPLE_VALUE_JY764gj7dhTnpnZPsHCF'},
            registry_version=460,
            labels=["EXAMPLE--Value"],
            is_favorite=False),
        registry_metadata=oci.data_connectivity.models.RegistryMetadata(
            aggregator_key="EXAMPLE-aggregatorKey-Value",
            labels=["EXAMPLE--Value"],
            registry_version=59,
            key="EXAMPLE-key-Value",
            is_favorite=True,
            created_by_user_id="ocid1.test.oc1..<unique_ID>EXAMPLE-createdByUserId-Value",
            created_by_user_name="EXAMPLE-createdByUserName-Value",
            updated_by_user_id="ocid1.test.oc1..<unique_ID>EXAMPLE-updatedByUserId-Value",
            updated_by_user_name="EXAMPLE-updatedByUserName-Value",
            time_created=datetime.strptime(
                "2005-12-11T07:01:28.725Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            time_updated=datetime.strptime(
                "2001-08-28T02:03:21.283Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"))),
    opc_request_id="3TMHOJGHLHGMM9PYX4LH<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

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