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


# Send the request to service, some parameters are not required, see API
# doc for more info
update_external_publication_response = data_integration_client.update_external_publication(
    workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
    task_key="EXAMPLE-taskKey-Value",
    external_publications_key="EXAMPLE-externalPublicationsKey-Value",
    update_external_publication_details=oci.data_integration.models.UpdateExternalPublicationDetails(
        application_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value",
        display_name="EXAMPLE-displayName-Value",
        application_id="ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value",
        description="EXAMPLE-description-Value",
        resource_configuration=oci.data_integration.models.ResourceConfiguration(
            spark_version="EXAMPLE-sparkVersion-Value",
            driver_shape="EXAMPLE-driverShape-Value",
            executor_shape="EXAMPLE-executorShape-Value",
            total_executors=836),
        configuration_details=oci.data_integration.models.ConfigurationDetails(
            data_asset=oci.data_integration.models.DataAssetFromJdbc(
                model_type="GENERIC_JDBC_DATA_ASSET",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_status=429,
                identifier="EXAMPLE-identifier-Value",
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_Qjkum': 'EXAMPLE_VALUE_xjDcgLZPBLsS2BlyiMhP'},
                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"),
                    name="EXAMPLE-name-Value",
                    description="EXAMPLE-description-Value",
                    object_version=691,
                    type_mapping_to={
                        'EXAMPLE_KEY_mylp5': 'EXAMPLE_VALUE_m1O1qfvvNTkNybSJoEEY'},
                    type_mapping_from={
                        'EXAMPLE_KEY_ZCBUW': 'EXAMPLE_VALUE_To3LsVJj1M8ZuDcL4sv9'},
                    object_status=92,
                    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"),
                            name="EXAMPLE-name-Value",
                            object_status=22,
                            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"),
                                        name="EXAMPLE-name-Value",
                                        is_contained=False,
                                        object_status=950,
                                        config_parameter_definitions={
                                            'EXAMPLE_KEY_eoXWM': {
                                                'parameterType': {
                                                    'modelType': 'DERIVED_TYPE',
                                                    'key': 'EXAMPLE-key-Value',
                                                    'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                    'parentRef': {
                                                        'parent': 'EXAMPLE-parent-Value'},
                                                    'name': 'EXAMPLE-name-Value',
                                                    'objectStatus': 957,
                                                    'description': 'EXAMPLE-description-Value'},
                                                'parameterName': 'EXAMPLE-parameterName-Value',
                                                'description': 'EXAMPLE-description-Value',
                                                'defaultValue': 'EXAMPLE-defaultValue-Value',
                                                                'classFieldName': 'EXAMPLE-classFieldName-Value',
                                                                'isStatic': False,
                                                'isClassFieldValue': False}}))]),
                object_version=395,
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-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(
                        "2036-02-08T18:46:32.197Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2017-06-18T19:27:46.078Z",
                        "%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_QX4mK': 'EXAMPLE_VALUE_RenCPeFFbY8lTpEuIcej'},
                    registry_version=199,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True),
                key_map={
                    'EXAMPLE_KEY_DoAFY': 'EXAMPLE_VALUE_KIIKG97c08Z0BLsRvmuG'},
                host="EXAMPLE-host-Value",
                port="EXAMPLE-port-Value",
                data_asset_type="EXAMPLE-dataAssetType-Value",
                default_connection=oci.data_integration.models.ConnectionFromJdbcDetails(
                    model_type="GENERIC_JDBC_CONNECTION",
                    key="EXAMPLE-key-Value",
                    model_version="EXAMPLE-modelVersion-Value",
                    parent_ref=oci.data_integration.models.ParentReference(
                        parent="EXAMPLE-parent-Value"),
                    name="EXAMPLE-name-Value",
                    description="EXAMPLE-description-Value",
                    object_version=367,
                    object_status=564,
                    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"),
                        name="EXAMPLE-name-Value",
                        resource_name="EXAMPLE-resourceName-Value",
                        description="EXAMPLE-description-Value",
                        object_version=819,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=True,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=538,
                        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(
                                    "2041-10-28T01:13:09.673Z",
                                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2039-01-08T23:26:31.042Z",
                                "%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_CWjkg': 'EXAMPLE_VALUE_ZCI11nRclAK6GAyNZcGi'},
                            registry_version=820,
                            labels=["EXAMPLE--Value"],
                            is_favorite=True)),
                    connection_properties=[
                        oci.data_integration.models.ConnectionProperty(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")],
                    is_default=False,
                    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(
                            "2005-10-21T16:19:23.117Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2038-12-13T12:06:41.796Z",
                            "%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_MWyPt': 'EXAMPLE_VALUE_2MMt9uYej9bjH9RKep2D'},
                        registry_version=449,
                        labels=["EXAMPLE--Value"],
                        is_favorite=True),
                    username="EXAMPLE-username-Value")),
            connection=oci.data_integration.models.ConnectionFromMySQL(
                model_type="MYSQL_CONNECTION",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                parent_ref=oci.data_integration.models.ParentReference(
                    parent="EXAMPLE-parent-Value"),
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_version=287,
                object_status=335,
                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"),
                    name="EXAMPLE-name-Value",
                    resource_name="EXAMPLE-resourceName-Value",
                    description="EXAMPLE-description-Value",
                    object_version=628,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=True,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=735,
                    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(
                                "2012-07-09T23:10:15.729Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2017-06-30T15:51:22.354Z",
                            "%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_VzLOR': 'EXAMPLE_VALUE_BzFJQG2gsclxQ5gmrPpw'},
                        registry_version=133,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False)),
                connection_properties=[
                    oci.data_integration.models.ConnectionProperty(
                        name="EXAMPLE-name-Value",
                        value="EXAMPLE-value-Value")],
                is_default=False,
                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(
                        "2035-05-18T17:50:30.298Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2048-10-17T00:56:22.318Z",
                        "%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_pFqYg': 'EXAMPLE_VALUE_lZeRAxTYO4l4YT1m6U4T'},
                    registry_version=401,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True),
                key_map={
                    'EXAMPLE_KEY_wuOvw': 'EXAMPLE_VALUE_688AKN3xnrqu1EJZ4THe'},
                username="EXAMPLE-username-Value"),
            compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
            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"),
                name="EXAMPLE-name-Value",
                resource_name="EXAMPLE-resourceName-Value",
                description="EXAMPLE-description-Value",
                object_version=109,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=False,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=747,
                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(
                            "2049-02-15T12:09:29.506Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2040-08-27T07:29:44.117Z",
                        "%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_EvjxT': 'EXAMPLE_VALUE_FEweLRRUp8AckHpbM16L'},
                    registry_version=93,
                    labels=["EXAMPLE--Value"],
                    is_favorite=False)))),
    opc_request_id="FMLTH5O2HA5ENJFIPIGB/OpcRequestIdExample/<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

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