# 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=412),
        configuration_details=oci.data_integration.models.ConfigurationDetails(
            data_asset=oci.data_integration.models.DataAssetFromLakeDetails(
                model_type="LAKE_DATA_ASSET",
                lake_id="ocid1.test.oc1..<unique_ID>EXAMPLE-lakeId-Value",
                default_connection=oci.data_integration.models.ConnectionFromLakeDetails(
                        model_type="LAKE_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=66,
                        object_status=727,
                        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=230,
                            external_key="EXAMPLE-externalKey-Value",
                            is_has_containers=False,
                            default_connection="EXAMPLE-defaultConnection-Value",
                            object_status=748,
                            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(
                                            "2002-08-21T16:15:43.968Z",
                                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                                time_updated=datetime.strptime(
                                            "2040-02-01T13:27:52.458Z",
                                            "%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_hutrY': 'EXAMPLE_VALUE_379YIMMp6jQyhoWmzBt4'},
                                registry_version=159,
                                labels=["EXAMPLE--Value"],
                                is_favorite=False,
                                count_statistics=oci.data_integration.models.CountStatistic(
                                            object_type_count_list=[
                                                oci.data_integration.models.CountStatisticSummary(
                                                    object_type="TASK",
                                                    object_count=20)]))),
                        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(
                                "2023-10-30T18:54:44.355Z",
                                "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2006-08-09T00:45:12.789Z",
                                "%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_zAIGa': 'EXAMPLE_VALUE_dydm0Vsqzr47zIDYPj9O'},
                            registry_version=37,
                            labels=["EXAMPLE--Value"],
                            is_favorite=False,
                            count_statistics=oci.data_integration.models.CountStatistic(
                                object_type_count_list=[
                                    oci.data_integration.models.CountStatisticSummary(
                                        object_type="APPLICATION",
                                        object_count=758)]))),
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_status=380,
                identifier="EXAMPLE-identifier-Value",
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                        'EXAMPLE_KEY_8CjxC': 'EXAMPLE_VALUE_bizQMK3rDkvNYqHPm6Ue'},
                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=163,
                    type_mapping_to={
                        'EXAMPLE_KEY_Abp0F': 'EXAMPLE_VALUE_JZCIWklQEyImyfaZSC9r'},
                    type_mapping_from={
                        'EXAMPLE_KEY_j3NKN': 'EXAMPLE_VALUE_UWRxsJoMGsuorulemmfG'},
                    object_status=25,
                    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=846,
                            description="EXAMPLE-description-Value",
                            dt_type="STRUCTURED",
                            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=984,
                                    config_parameter_definitions={
                                        'EXAMPLE_KEY_LAP50': {
                                            'parameterType': {
                                                'modelType': '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': 189,
                                                'description': 'EXAMPLE-description-Value',
                                                'elements': [
                                                    {
                                                        'modelType': 'TYPED_EXPRESSION',
                                                        'key': 'EXAMPLE-key-Value',
                                                        'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                        'parentRef': {
                                                            'parent': 'EXAMPLE-parent-Value',
                                                            'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
                                                        'configValues': {
                                                            'configParamValues': {
                                                                'EXAMPLE_KEY_bQlmt': {
                                                                    'stringValue': 'EXAMPLE-stringValue-Value',
                                                                    'intValue': 367,
                                                                    'objectValue': 'EXAMPLE-objectValue-Value',
                                                                    'refValue': 'EXAMPLE-refValue-Value',
                                                                    'parameterValue': 'EXAMPLE-parameterValue-Value',
                                                                    'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
                                                            'parentRef': {
                                                                'parent': 'EXAMPLE-parent-Value',
                                                                'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'}},
                                                        'objectStatus': 669,
                                                        'name': 'EXAMPLE-name-Value',
                                                        'description': 'EXAMPLE-description-Value',
                                                        'expression': 'EXAMPLE-expression-Value',
                                                        'type': 'EXAMPLE-type-Value'}]},
                                            'parameterName': 'EXAMPLE-parameterName-Value',
                                            'description': 'EXAMPLE-description-Value',
                                            'defaultValue': 'EXAMPLE-defaultValue-Value',
                                            'classFieldName': 'EXAMPLE-classFieldName-Value',
                                            'isStatic': False,
                                            'isClassFieldValue': False}}))]),
                object_version=889,
                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(
                        "2020-04-19T14:35:17.911Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2002-11-22T23:09:46.326Z",
                        "%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_CUX4I': 'EXAMPLE_VALUE_SuLH0MsqJ6x9elZCevlp'},
                    registry_version=876,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="FUNCTION_LIBRARY",
                                object_count=289)])),
                key_map={
                    'EXAMPLE_KEY_Eahxj': 'EXAMPLE_VALUE_ZjYyjhSCMzarhiMyjaxT'},
                metastore_id="ocid1.test.oc1..<unique_ID>EXAMPLE-metastoreId-Value",
                lake_proxy_endpoint="EXAMPLE-lakeProxyEndpoint-Value"),
            connection=oci.data_integration.models.ConnectionFromOAuth2(
                model_type="OAUTH2_CONNECTION",
                access_token_url="EXAMPLE-accessTokenUrl-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"),
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_version=750,
                object_status=894,
                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=25,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=True,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=753,
                    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(
                                "2014-11-27T11:03:34.549Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2022-08-11T06:47:39.991Z",
                            "%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_qcSdu': 'EXAMPLE_VALUE_yt06luPrPKTMK7abwtZb'},
                        registry_version=459,
                        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=329)]))),
                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(
                        "2028-08-19T15:50:59.523Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2001-01-05T08:06:30.005Z",
                        "%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_38DQS': 'EXAMPLE_VALUE_UDjrLxCFbciqF34GSHIH'},
                    registry_version=520,
                    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=101)])),
                key_map={
                    'EXAMPLE_KEY_B6fSK': 'EXAMPLE_VALUE_4iMzI4IgU5L2KzUrwXXj'},
                client_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value",
                client_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"),
                scope="EXAMPLE-scope-Value",
                grant_type="CLIENT_CREDENTIALS"),
            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",
                    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=751,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=False,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=310,
                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(
                            "2001-05-20T01:30:46.357Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2048-02-04T20:20:39.175Z",
                        "%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_NRLG1': 'EXAMPLE_VALUE_rSrYL4e3igi5zKd1LzGk'},
                    registry_version=884,
                    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=927)]))))),
    opc_request_id="BTM6ITI7QM31DTXUJEPN<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

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