# 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
create_external_publication_response = data_integration_client.create_external_publication(
    workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
    task_key="EXAMPLE-taskKey-Value",
    create_external_publication_details=oci.data_integration.models.CreateExternalPublicationDetails(
        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=777),
        configuration_details=oci.data_integration.models.ConfigurationDetails(
            data_asset=oci.data_integration.models.DataAssetFromFusionApp(
                model_type="FUSION_APP_DATA_ASSET",
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_status=882,
                identifier="EXAMPLE-identifier-Value",
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_8OxBf': 'EXAMPLE_VALUE_EQPszlRZjwPwc0Zd4pIN'},
                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=451,
                    type_mapping_to={
                        'EXAMPLE_KEY_q6CR8': 'EXAMPLE_VALUE_oO5eSwfQBM0FQpRKcpu5'},
                    type_mapping_from={
                        'EXAMPLE_KEY_DC2ml': 'EXAMPLE_VALUE_FDKt4O3EQS6CtgYQ5Djz'},
                    object_status=495,
                    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=793,
                            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=True,
                                        object_status=697,
                                        config_parameter_definitions={
                                            'EXAMPLE_KEY_rCqSh': {
                                                'parameterType': {
                                                    'modelType': 'DYNAMIC_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': 455,
                                                    'description': 'EXAMPLE-description-Value',
                                                    'typeHandler': {
                                                        'modelType': 'RULE_TYPE_CONFIGS',
                                                        'key': 'EXAMPLE-key-Value',
                                                        'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                        'parentRef': {
                                                            'parent': 'EXAMPLE-parent-Value',
                                                            'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
                                                        'scope': 'EXAMPLE-scope-Value',
                                                        'isOrderByRule': False,
                                                        'projectionRules': [
                                                            {
                                                                'modelType': 'NAME_LIST_RULE',
                                                                'key': 'EXAMPLE-key-Value',
                                                                'modelVersion': 'EXAMPLE-modelVersion-Value',
                                                                'parentRef': {
                                                                    'parent': 'EXAMPLE-parent-Value',
                                                                    'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
                                                                'isJavaRegexSyntax': True,
                                                                'configValues': {
                                                                    'configParamValues': {
                                                                        'EXAMPLE_KEY_zgTMT': {
                                                                            'stringValue': 'EXAMPLE-stringValue-Value',
                                                                            'intValue': 485,
                                                                            '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': 263,
                                                                'description': 'EXAMPLE-description-Value',
                                                                'isSkipRemainingRulesOnMatch': True,
                                                                'scope': 'EXAMPLE-scope-Value',
                                                                'isCascade': True,
                                                                'matchingStrategy': 'NAME_OR_TAGS',
                                                                'isCaseSensitive': False,
                                                                'ruleType': 'INCLUDE',
                                                                'names': ['EXAMPLE--Value']}],
                                                        'configValues': {
                                                            'configParamValues': {
                                                                'EXAMPLE_KEY_bxtrW': {
                                                                    'stringValue': 'EXAMPLE-stringValue-Value',
                                                                    'intValue': 17,
                                                                    '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': 580}},
                                                'parameterName': 'EXAMPLE-parameterName-Value',
                                                'description': 'EXAMPLE-description-Value',
                                                'defaultValue': 'EXAMPLE-defaultValue-Value',
                                                                'classFieldName': 'EXAMPLE-classFieldName-Value',
                                                                'isStatic': False,
                                                'isClassFieldValue': False}}))]),
                object_version=141,
                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(
                        "2028-06-18T12:47:59.169Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2046-09-16T06:33:47.749Z",
                        "%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_R7ffa': 'EXAMPLE_VALUE_y2C05M5bvtlPx1IhF3HD'},
                    registry_version=280,
                    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=84)])),
                key_map={
                    'EXAMPLE_KEY_T7Qlh': 'EXAMPLE_VALUE_FnZPZ4qwcYahwMtazutl'},
                service_url="EXAMPLE-serviceUrl-Value",
                default_connection=oci.data_integration.models.ConnectionFromBICCDetails(
                    model_type="BICC_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=130,
                    object_status=90,
                    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=274,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=True,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=922,
                        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(
                                    "2020-12-24T02:19:57.649Z",
                                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2030-04-01T02:12:40.873Z",
                                "%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_wgmP8': 'EXAMPLE_VALUE_JWr7etFEQO5wZ6bTABjJ'},
                            registry_version=295,
                            labels=["EXAMPLE--Value"],
                            is_favorite=True,
                            count_statistics=oci.data_integration.models.CountStatistic(
                                object_type_count_list=[
                                    oci.data_integration.models.CountStatisticSummary(
                                        object_type="FOLDER",
                                        object_count=426)]))),
                    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(
                            "2032-03-02T22:00:30.937Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2036-11-08T12:15:48.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_IJ6e6': 'EXAMPLE_VALUE_VUz1XV7hU6dbiMBmGYoB'},
                        registry_version=606,
                        labels=["EXAMPLE--Value"],
                        is_favorite=True,
                        count_statistics=oci.data_integration.models.CountStatistic(
                            object_type_count_list=[
                                oci.data_integration.models.CountStatisticSummary(
                                    object_type="FOLDER",
                                    object_count=172)])),
                    username="EXAMPLE-username-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"),
                    default_external_storage=oci.data_integration.models.ExternalStorage(
                        model_type="EXTERNAL_STORAGE",
                        storage_id="ocid1.test.oc1..<unique_ID>EXAMPLE-storageId-Value",
                        storage_name="EXAMPLE-storageName-Value",
                        host="EXAMPLE-host-Value",
                        tenancy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value",
                        namespace="EXAMPLE-namespace-Value",
                        bucket="EXAMPLE-bucket-Value"))),
            connection=oci.data_integration.models.ConnectionFromAmazonS3(
                model_type="AMAZON_S3_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=622,
                object_status=619,
                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=240,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=False,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=450,
                    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(
                                "2003-11-21T05:18:22.375Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2014-05-11T15:11:37.682Z",
                            "%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_IoiO8': 'EXAMPLE_VALUE_SJKBDl1h56UhqrzKcZom'},
                        registry_version=448,
                        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=924)]))),
                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(
                        "2041-08-12T06:21:07.656Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2029-06-26T00:58:34.594Z",
                        "%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_TygzN': 'EXAMPLE_VALUE_7tzfxbBCwMBohWFJod3Q'},
                    registry_version=635,
                    labels=["EXAMPLE--Value"],
                    is_favorite=False,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="CONNECTION",
                                object_count=102)])),
                key_map={
                    'EXAMPLE_KEY_lsXDN': 'EXAMPLE_VALUE_pCGnhtW5piDfVBdzAcqo'},
                access_key=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"),
                secret_key=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")),
            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=669,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=True,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=761,
                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(
                            "2008-06-19T09:24:59.622Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2014-07-02T02:59:59.878Z",
                        "%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_BOb3L': 'EXAMPLE_VALUE_2XDdu6tqkCEEmflRNw5T'},
                    registry_version=365,
                    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=741)]))))),
    opc_request_id="VHLEVJCMLFTLMPLUWJEL<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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