# 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_attach_data_asset_response = data_connectivity_client.create_attach_data_asset(
    registry_id="ocid1.test.oc1..<unique_ID>EXAMPLE-registryId-Value",
    endpoint_id="ocid1.test.oc1..<unique_ID>EXAMPLE-endpointId-Value",
    create_attach_data_asset_details=oci.data_connectivity.models.CreateAttachDataAssetDetails(
        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=322,
                object_version=275,
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_Y7Md4': 'EXAMPLE_VALUE_VKpmRCVpM3f5DyoiKb9Y'},
                properties={
                    'EXAMPLE_KEY_qem9N': '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=81,
                    type_mapping_to={
                                'EXAMPLE_KEY_kSFR4': 'EXAMPLE_VALUE_g15MYsCB3WtzhNVlE2vg'},
                    type_mapping_from={
                        'EXAMPLE_KEY_tFI7c': 'EXAMPLE_VALUE_7NPicwPe8WrhV9QxcBm3'},
                    object_status=230,
                    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=372,
                            description="EXAMPLE-description-Value",
                            dt_type="PRIMITIVE",
                            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=908,
                                        config_parameter_definitions={
                                            'EXAMPLE_KEY_tws57': {
                                                'parameterType': {
                                                    'modelType': 'COMPOSITE_TYPE',
                                                    'key': 'EXAMPLE-key-Value',
                                                    'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                    'parentRef': {
                                                        'parent': 'EXAMPLE-parent-Value'},
                                                    'name': 'EXAMPLE-name-Value',
                                                    'objectStatus': 2,
                                                    'description': 'EXAMPLE-description-Value',
                                                    'elements': [
                                                        {
                                                            'modelType': 'PARAMETER',
                                                            'key': 'EXAMPLE-key-Value',
                                                            'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                            'parentRef': {
                                                                'parent': 'EXAMPLE-parent-Value'},
                                                            'configValues': {
                                                                'configParamValues': {
                                                                    'EXAMPLE_KEY_tOVbS': {
                                                                        'stringValue': 'EXAMPLE-stringValue-Value',
                                                                        'intValue': 809,
                                                                        'objectValue': 'EXAMPLE-objectValue-Value',
                                                                        'refValue': 'EXAMPLE-refValue-Value',
                                                                        'parameterValue': 'EXAMPLE-parameterValue-Value'}},
                                                                'parentRef': {
                                                                    'parent': 'EXAMPLE-parent-Value'}},
                                                            'objectStatus': 273,
                                                            'name': 'EXAMPLE-name-Value',
                                                            'description': 'EXAMPLE-description-Value',
                                                            'defaultValue': 'EXAMPLE-defaultValue-Value',
                                                            'rootObjectDefaultValue': 'EXAMPLE-rootObjectDefaultValue-Value',
                                                            'isInput': True,
                                                            'isOutput': False,
                                                            'outputAggregationType': 'MIN',
                                                            'typeName': 'EXAMPLE-typeName-Value'}]},
                                                'parameterName': 'EXAMPLE-parameterName-Value',
                                                'description': 'EXAMPLE-description-Value',
                                                'defaultValue': 'EXAMPLE-defaultValue-Value',
                                                                'classFieldName': 'EXAMPLE-classFieldName-Value',
                                                                'isStatic': True,
                                                'isClassFieldValue': False}}))]),
                registry_metadata=oci.data_connectivity.models.RegistryMetadata(
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    labels=["EXAMPLE--Value"],
                    registry_version=857,
                    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(
                        "2038-11-13T09:27:41.526Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2048-09-07T03:29:54.338Z",
                        "%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(
                        "2017-06-02T01:16:46.583Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2031-07-26T11:31:54.318Z",
                        "%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_HDRfj': 'EXAMPLE_VALUE_xC9uwqLNyzoZLciRXQ8j'},
                    registry_version=440,
                    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=177,
                    object_status=683,
                    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=857,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=True,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=751,
                        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(
                                "2019-02-16T03:22:09.496Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2045-02-10T03:49:03.911Z",
                                "%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_qE2VZ': 'EXAMPLE_VALUE_2MMogE7vOnlXMF2wHsWy'},
                            registry_version=860,
                            labels=["EXAMPLE--Value"],
                            is_favorite=False)),
                    connection_properties=[
                        oci.data_connectivity.models.ConnectionProperty(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")],
                    properties={
                        'EXAMPLE_KEY_DSHab': '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(
                            "2046-05-03T01:09:02.139Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2007-02-12T14:11:11.822Z",
                            "%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_4E5CH': 'EXAMPLE_VALUE_kfIwlCjpHsGckMME74QW'},
                        registry_version=854,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False),
                    registry_metadata=oci.data_connectivity.models.RegistryMetadata(
                        aggregator_key="EXAMPLE-aggregatorKey-Value",
                        labels=["EXAMPLE--Value"],
                        registry_version=962,
                        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(
                            "2021-11-01T00:18:57.981Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2004-10-19T06:29:38.687Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"))),
                end_points=[
                    oci.data_connectivity.models.DpEndpointFromPrivate(
                        model_type="PRIVATE_END_POINT",
                        dcms_endpoint_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dcmsEndpointId-Value",
                        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=436,
                        object_status=621,
                        identifier="EXAMPLE-identifier-Value",
                        pe_id="ocid1.test.oc1..<unique_ID>EXAMPLE-peId-Value",
                        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                        dns_proxy_ip="EXAMPLE-dnsProxyIp-Value",
                        private_endpoint_ip="EXAMPLE-privateEndpointIp-Value",
                        dns_zones=["EXAMPLE--Value"],
                        state="ACTIVE")])]),
    opc_request_id="RUO9Z5YJU6M3DLDZBWVC<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    if_match="EXAMPLE-ifMatch-Value")

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