# 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_integration_client = oci.data_integration.DataIntegrationClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_connection_validation_response = data_integration_client.create_connection_validation(
    workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
    create_connection_validation_details=oci.data_integration.models.CreateConnectionValidationDetails(
        data_asset=oci.data_integration.models.CreateDataAssetFromAdwc(
            model_type="ORACLE_ADWC_DATA_ASSET",
            name="EXAMPLE-name-Value",
            identifier="EXAMPLE-identifier-Value",
            key="EXAMPLE-key-Value",
            model_version="EXAMPLE-modelVersion-Value",
            description="EXAMPLE-description-Value",
            object_status=208,
            external_key="EXAMPLE-externalKey-Value",
            asset_properties={
                'EXAMPLE_KEY_mmfG1': 'EXAMPLE_VALUE_8ppiMwfAVigZc2Bs2NKy'},
            registry_metadata=oci.data_integration.models.RegistryMetadata(
                aggregator_key="EXAMPLE-aggregatorKey-Value",
                labels=["EXAMPLE--Value"],
                registry_version=952,
                key="EXAMPLE-key-Value",
                is_favorite=True),
            service_name="EXAMPLE-serviceName-Value",
            driver_class="EXAMPLE-driverClass-Value",
            credential_file_content="EXAMPLE-credentialFileContent-Value",
            wallet_secret=oci.data_integration.models.SensitiveAttribute(
                secret_config=oci.data_integration.models.OciVaultSecretConfig(
                    model_type="OCI_VAULT_SECRET_CONFIG",
                    secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
                value="EXAMPLE-value-Value"),
            wallet_password_secret=oci.data_integration.models.SensitiveAttribute(
                secret_config=oci.data_integration.models.OciVaultSecretConfig(
                    model_type="OCI_VAULT_SECRET_CONFIG",
                    secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
                value="EXAMPLE-value-Value"),
            region_id="ocid1.test.oc1..<unique_ID>EXAMPLE-regionId-Value",
            tenancy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value",
            compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
            autonomous_db_id="ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDbId-Value",
            default_connection=oci.data_integration.models.CreateConnectionFromAdwc(
                model_type="ORACLE_ADWC_CONNECTION",
                name="EXAMPLE-name-Value",
                identifier="EXAMPLE-identifier-Value",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                description="EXAMPLE-description-Value",
                object_status=949,
                connection_properties=[
                    oci.data_integration.models.ConnectionProperty(
                        name="EXAMPLE-name-Value",
                        value="EXAMPLE-value-Value")],
                registry_metadata=oci.data_integration.models.RegistryMetadata(
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    labels=["EXAMPLE--Value"],
                    registry_version=138,
                    key="EXAMPLE-key-Value",
                    is_favorite=False),
                tns_alias="EXAMPLE-tnsAlias-Value",
                tns_names=["EXAMPLE--Value"],
                username="EXAMPLE-username-Value",
                password="EXAMPLE-password-Value",
                password_secret=oci.data_integration.models.SensitiveAttribute(
                    secret_config=oci.data_integration.models.OciVaultSecretConfig(
                        model_type="OCI_VAULT_SECRET_CONFIG",
                        secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
                    value="EXAMPLE-value-Value")),
            staging_data_asset=oci.data_integration.models.DataAssetFromMySQL(
                model_type="MYSQL_DATA_ASSET",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_status=77,
                identifier="EXAMPLE-identifier-Value",
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_Gm4EE': 'EXAMPLE_VALUE_gbtBczKp5imIgyg2MBO8'},
                native_type_system=oci.data_integration.models.TypeSystem(
                    key="EXAMPLE-key-Value",
                    model_type="EXAMPLE-modelType-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                    name="EXAMPLE-name-Value",
                    description="EXAMPLE-description-Value",
                    object_version=511,
                    type_mapping_to={
                        'EXAMPLE_KEY_rKYo5': 'EXAMPLE_VALUE_qqWmCSbQlmtL1l5FUqp0'},
                    type_mapping_from={
                        'EXAMPLE_KEY_3VXgZ': 'EXAMPLE_VALUE_OqtR4lGZbP8LAP50ncmU'},
                    object_status=244,
                    identifier="EXAMPLE-identifier-Value",
                    types=[
                        oci.data_integration.models.DataType(
                            model_type="DATA_TYPE",
                            key="EXAMPLE-key-Value",
                            model_version="EXAMPLE-modelVersion-Value",
                            parent_ref=oci.data_integration.models.ParentReference(
                                parent="EXAMPLE-parent-Value",
                                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                            name="EXAMPLE-name-Value",
                            object_status=265,
                            description="EXAMPLE-description-Value",
                            dt_type="PRIMITIVE",
                            type_system_name="EXAMPLE-typeSystemName-Value",
                            config_definition=oci.data_integration.models.ConfigDefinition(
                                key="EXAMPLE-key-Value",
                                model_type="EXAMPLE-modelType-Value",
                                model_version="EXAMPLE-modelVersion-Value",
                                parent_ref=oci.data_integration.models.ParentReference(
                                    parent="EXAMPLE-parent-Value",
                                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                                name="EXAMPLE-name-Value",
                                is_contained=False,
                                object_status=10,
                                config_parameter_definitions={
                                    'EXAMPLE_KEY_eDGgE': {
                                        'parameterType': {
                                            'modelType': 'MATERIALIZED_COMPOSITE_TYPE',
                                            'key': 'EXAMPLE-key-Value',
                                            'modelVersion': 'EXAMPLE-modelVersion-Value',
                                            'parentRef': {
                                                'parent': 'EXAMPLE-parent-Value',
                                                'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
                                            'name': 'EXAMPLE-name-Value',
                                            'objectStatus': 171,
                                            'description': 'EXAMPLE-description-Value',
                                            'elements': ['EXAMPLE--Value'],
                                            'pathNames': ['EXAMPLE--Value']},
                                        'parameterName': 'EXAMPLE-parameterName-Value',
                                        'description': 'EXAMPLE-description-Value',
                                        'defaultValue': 'EXAMPLE-defaultValue-Value',
                                        'classFieldName': 'EXAMPLE-classFieldName-Value',
                                        'isStatic': False,
                                        'isClassFieldValue': False}}))]),
                object_version=554,
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                metadata=oci.data_integration.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-06-07T11:52:13.688Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2033-06-11T00:07:49.548Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    aggregator=oci.data_integration.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_hSCMz': 'EXAMPLE_VALUE_arhiMyjaxTjcgttLla94'},
                    registry_version=774,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="CONNECTION",
                                object_count=90)])),
                key_map={
                    'EXAMPLE_KEY_cSduy': 'EXAMPLE_VALUE_t06luPrPKTMK7abwtZb9'},
                host="EXAMPLE-host-Value",
                port="EXAMPLE-port-Value",
                service_name="EXAMPLE-serviceName-Value",
                default_connection=oci.data_integration.models.ConnectionFromMySQLDetails(
                    model_type="MYSQL_CONNECTION",
                    key="EXAMPLE-key-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                    name="EXAMPLE-name-Value",
                    description="EXAMPLE-description-Value",
                    object_version=571,
                    object_status=866,
                    identifier="EXAMPLE-identifier-Value",
                    primary_schema=oci.data_integration.models.Schema(
                        key="EXAMPLE-key-Value",
                        model_type="EXAMPLE-modelType-Value",
                        model_version="EXAMPLE-modelVersion-Value",
                        parent_ref=oci.data_integration.models.ParentReference(
                            parent="EXAMPLE-parent-Value",
                            root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                        name="EXAMPLE-name-Value",
                        resource_name="EXAMPLE-resourceName-Value",
                        description="EXAMPLE-description-Value",
                        object_version=944,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=True,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=318,
                        identifier="EXAMPLE-identifier-Value",
                        metadata=oci.data_integration.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(
                                "2028-01-17T02:12:14.058Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2034-04-01T08:27:15.747Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"),
                            aggregator_key="EXAMPLE-aggregatorKey-Value",
                            aggregator=oci.data_integration.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_Ld38D': 'EXAMPLE_VALUE_QSUDjrLxCFbciqF34GSH'},
                            registry_version=456,
                            labels=["EXAMPLE--Value"],
                            is_favorite=True,
                            count_statistics=oci.data_integration.models.CountStatistic(
                                object_type_count_list=[
                                    oci.data_integration.models.CountStatisticSummary(
                                        object_type="APPLICATION",
                                        object_count=622)]))),
                    connection_properties=[
                        oci.data_integration.models.ConnectionProperty(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")],
                    is_default=True,
                    metadata=oci.data_integration.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-06-19T09:30:54.281Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2031-09-26T20:27:03.177Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        aggregator_key="EXAMPLE-aggregatorKey-Value",
                        aggregator=oci.data_integration.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_zI4Ig': 'EXAMPLE_VALUE_U5L2KzUrwXXjPIjzN0BC'},
                        registry_version=725,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False,
                        count_statistics=oci.data_integration.models.CountStatistic(
                            object_type_count_list=[
                                oci.data_integration.models.CountStatisticSummary(
                                    object_type="DATA_ASSET",
                                    object_count=358)])),
                    username="EXAMPLE-username-Value")),
            staging_connection=oci.data_integration.models.ConnectionFromObjectStorage(
                model_type="ORACLE_OBJECT_STORAGE_CONNECTION",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_version=97,
                object_status=679,
                identifier="EXAMPLE-identifier-Value",
                primary_schema=oci.data_integration.models.Schema(
                    key="EXAMPLE-key-Value",
                    model_type="EXAMPLE-modelType-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value",
                        root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                    name="EXAMPLE-name-Value",
                    resource_name="EXAMPLE-resourceName-Value",
                    description="EXAMPLE-description-Value",
                    object_version=237,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=False,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=311,
                    identifier="EXAMPLE-identifier-Value",
                    metadata=oci.data_integration.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-03-06T15:03:38.681Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2024-10-27T01:40:49.524Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        aggregator_key="EXAMPLE-aggregatorKey-Value",
                        aggregator=oci.data_integration.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_gi5zK': 'EXAMPLE_VALUE_d1LzGkMs4siebTm6ItI7'},
                        registry_version=540,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False,
                        count_statistics=oci.data_integration.models.CountStatistic(
                            object_type_count_list=[
                                oci.data_integration.models.CountStatisticSummary(
                                    object_type="FUNCTION_LIBRARY",
                                    object_count=504)]))),
                connection_properties=[
                    oci.data_integration.models.ConnectionProperty(
                        name="EXAMPLE-name-Value",
                        value="EXAMPLE-value-Value")],
                is_default=True,
                metadata=oci.data_integration.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(
                        "2049-01-31T13:52:52.107Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2022-06-01T11:39:02.426Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    aggregator=oci.data_integration.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_LB0R0': 'EXAMPLE_VALUE_Ljo4SdfuNLj3Q7rR5uxr'},
                    registry_version=283,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="APPLICATION",
                                object_count=664)])),
                key_map={
                    'EXAMPLE_KEY_FTn1z': 'EXAMPLE_VALUE_VSlalICCceOsnkYoEKfq'},
                credential_file_content="EXAMPLE-credentialFileContent-Value",
                user_id="ocid1.test.oc1..<unique_ID>EXAMPLE-userId-Value",
                finger_print="EXAMPLE-fingerPrint-Value",
                pass_phrase="EXAMPLE-passPhrase-Value"),
            bucket_schema=oci.data_integration.models.Schema(
                key="EXAMPLE-key-Value",
                model_type="EXAMPLE-modelType-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value",
                    root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
                name="EXAMPLE-name-Value",
                resource_name="EXAMPLE-resourceName-Value",
                description="EXAMPLE-description-Value",
                object_version=542,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=True,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=372,
                identifier="EXAMPLE-identifier-Value",
                metadata=oci.data_integration.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(
                        "2009-11-29T01:44:59.796Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2005-11-25T14:54:42.226Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    aggregator_key="EXAMPLE-aggregatorKey-Value",
                    aggregator=oci.data_integration.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_9Bwp9': 'EXAMPLE_VALUE_hVBhZZgvISJE1AoWLeqA'},
                    registry_version=552,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="DATA_ASSET",
                                object_count=814)])))),
        connection=oci.data_integration.models.CreateConnectionFromOracle(
            model_type="ORACLEDB_CONNECTION",
            name="EXAMPLE-name-Value",
            identifier="EXAMPLE-identifier-Value",
            key="EXAMPLE-key-Value",
            model_version="EXAMPLE-modelVersion-Value",
            parent_ref=oci.data_integration.models.ParentReference(
                parent="EXAMPLE-parent-Value",
                root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
            description="EXAMPLE-description-Value",
            object_status=472,
            connection_properties=[
                oci.data_integration.models.ConnectionProperty(
                    name="EXAMPLE-name-Value",
                    value="EXAMPLE-value-Value")],
            registry_metadata=oci.data_integration.models.RegistryMetadata(
                aggregator_key="EXAMPLE-aggregatorKey-Value",
                labels=["EXAMPLE--Value"],
                registry_version=929,
                key="EXAMPLE-key-Value",
                is_favorite=False),
            username="EXAMPLE-username-Value",
            password="EXAMPLE-password-Value",
            password_secret=oci.data_integration.models.SensitiveAttribute(
                secret_config=oci.data_integration.models.OciVaultSecretConfig(
                    model_type="OCI_VAULT_SECRET_CONFIG",
                    secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
                value="EXAMPLE-value-Value")),
        registry_metadata=oci.data_integration.models.RegistryMetadata(
            aggregator_key="EXAMPLE-aggregatorKey-Value",
            labels=["EXAMPLE--Value"],
            registry_version=51,
            key="EXAMPLE-key-Value",
            is_favorite=False)),
    opc_request_id="ZTQLHJVP9TKTSMTL9EFE<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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