# 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
create_detach_data_asset_response = data_connectivity_client.create_detach_data_asset(
    registry_id="ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value",
    endpoint_id="ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value",
    create_detach_data_asset_details=oci.data_connectivity.models.CreateDetachDataAssetDetails(
        data_assets=[
            oci.data_connectivity.models.DataAsset(
                key="EXAMPLE-key-Value",
                name="EXAMPLE-name-Value",
                identifier="EXAMPLE-identifier-Value",
                model_version="EXAMPLE-modelVersion-Value",
                model_type="EXAMPLE-modelType-Value",
                description="EXAMPLE-description-Value",
                object_status=45,
                object_version=304,
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_UVPNC': 'EXAMPLE_VALUE_dosHdrwJAzyWiEGk0ah9'},
                properties={
                    'EXAMPLE_KEY_PcBO6': 'EXAMPLE--Value'},
                type="EXAMPLE-type-Value",
                native_type_system=oci.data_connectivity.models.TypeSystem(
                    key="EXAMPLE-key-Value",
                    model_type="EXAMPLE-modelType-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    parent_ref=oci.data_connectivity.models.ParentReference(
                        parent="EXAMPLE-parent-Value"),
                    name="EXAMPLE-name-Value",
                    description="EXAMPLE-description-Value",
                    object_version=118,
                    type_mapping_to={
                                'EXAMPLE_KEY_wrSJ8': 'EXAMPLE_VALUE_QPhoImaCjpKcNUm3XtYS'},
                    type_mapping_from={
                        'EXAMPLE_KEY_F4Xps': 'EXAMPLE_VALUE_ZD9FzQAH1IjRJtfGhWrw'},
                    object_status=77,
                    identifier="EXAMPLE-identifier-Value",
                    types=[
                        oci.data_connectivity.models.DataType(
                            model_type="DATA_TYPE",
                            key="EXAMPLE-key-Value",
                            model_version="EXAMPLE-modelVersion-Value",
                            parent_ref=oci.data_connectivity.models.ParentReference(
                                parent="EXAMPLE-parent-Value"),
                            name="EXAMPLE-name-Value",
                            object_status=9,
                            description="EXAMPLE-description-Value",
                            dt_type="STRUCTURED",
                            type_system_name="EXAMPLE-typeSystemName-Value",
                            config_definition=oci.data_connectivity.models.ConfigDefinition(
                                        key="EXAMPLE-key-Value",
                                        model_type="EXAMPLE-modelType-Value",
                                        model_version="EXAMPLE-modelVersion-Value",
                                        parent_ref=oci.data_connectivity.models.ParentReference(
                                            parent="EXAMPLE-parent-Value"),
                                        name="EXAMPLE-name-Value",
                                        is_contained=False,
                                        object_status=702,
                                        config_parameter_definitions={
                                            'EXAMPLE_KEY_74PuA': {
                                                'parameterType': {
                                                    'modelType': 'STRUCTURED_TYPE',
                                                    'key': 'EXAMPLE-key-Value',
                                                    'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                    'parentRef': {
                                                        'parent': 'EXAMPLE-parent-Value'},
                                                    'name': 'EXAMPLE-name-Value',
                                                    'objectStatus': 631,
                                                    'description': 'EXAMPLE-description-Value'},
                                                'parameterName': 'EXAMPLE-parameterName-Value',
                                                'description': 'EXAMPLE-description-Value',
                                                'defaultValue': 'EXAMPLE-defaultValue-Value',
                                                                'classFieldName': 'EXAMPLE-classFieldName-Value',
                                                                'isStatic': False,
                                                'isClassFieldValue': False}}))]),
                registry_metadata=oci.data_connectivity.models.RegistryMetadata(
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    labels=["EXAMPLE--Value"],
                    registry_version=529,
                    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(
                        "2023-07-25T11:13:10.403Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2038-04-23T01:52:20.073Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ")),
                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(
                        "2029-01-02T12:50:35.584Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2027-02-20T07:35:30.432Z",
                        "%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_LaPUA': 'EXAMPLE_VALUE_DVwdVj9t2yN53iULS8Py'},
                    registry_version=485,
                    labels=["EXAMPLE--Value"],
                    is_favorite=False),
                default_connection=oci.data_connectivity.models.Connection(
                    key="EXAMPLE-key-Value",
                    name="EXAMPLE-name-Value",
                    identifier="EXAMPLE-identifier-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    model_type="EXAMPLE-modelType-Value",
                    description="EXAMPLE-description-Value",
                    object_version=6,
                    object_status=336,
                    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=534,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=False,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=392,
                        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(
                                "2011-10-23T02:02:39.236Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2041-09-22T07:50:04.228Z",
                                "%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_6CKtI': 'EXAMPLE_VALUE_IzQmlc3W09ecNHUDGbsw'},
                            registry_version=171,
                            labels=["EXAMPLE--Value"],
                            is_favorite=False)),
                    connection_properties=[
                        oci.data_connectivity.models.ConnectionProperty(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")],
                    properties={
                        'EXAMPLE_KEY_s6btT': 'EXAMPLE--Value'},
                    type="EXAMPLE-type-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(
                            "2034-01-26T20:52:21.613Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2026-12-03T15:29:23.972Z",
                            "%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_VbIxp': 'EXAMPLE_VALUE_fwBGu6GKWg5rdFNbMuom'},
                        registry_version=296,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False),
                    registry_metadata=oci.data_connectivity.models.RegistryMetadata(
                        aggregator_key="EXAMPLE-aggregatorKey-Value",
                        labels=["EXAMPLE--Value"],
                        registry_version=706,
                        key="EXAMPLE-key-Value",
                        is_favorite=False,
                        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(
                            "2015-04-16T14:42:06.396Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2032-07-31T22:31:15.507Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"))),
                end_points=[
                    oci.data_connectivity.models.DpEndpointFromPublic(
                        model_type="PUBLIC_END_POINT",
                        key="EXAMPLE-key-Value",
                        model_version="EXAMPLE-modelVersion-Value",
                        parent_ref=oci.data_connectivity.models.ParentReference(
                            parent="EXAMPLE-parent-Value"),
                        name="EXAMPLE-name-Value",
                        description="EXAMPLE-description-Value",
                        object_version=610,
                        object_status=532,
                        identifier="EXAMPLE-identifier-Value")])]),
    opc_request_id="08V10G9RGNM4LVQSMLXX<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    if_match="EXAMPLE-ifMatch-Value")

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