/** 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 com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.dataintegration.DataIntegrationClient;
import com.oracle.bmc.dataintegration.model.*;
import com.oracle.bmc.dataintegration.requests.*;
import com.oracle.bmc.dataintegration.responses.*;
import java.math.BigDecimal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.UUID;
import java.util.Arrays;


public class UpdateExternalPublicationExample {
    public static void main(String[] args) throws Exception {

        /**
         * Create a default authentication provider that uses the DEFAULT
         * profile in the configuration file.
         * Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
         */
        final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
        final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);

        /* Create a service client */
        DataIntegrationClient client = DataIntegrationClient.builder().build(provider);

        /* Create a request and dependent object(s). */
	UpdateExternalPublicationDetails updateExternalPublicationDetails = UpdateExternalPublicationDetails.builder()
		.applicationId("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value")
		.applicationCompartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value")
		.displayName("EXAMPLE-displayName-Value")
		.description("EXAMPLE-description-Value")
		.resourceConfiguration(ResourceConfiguration.builder()
			.sparkVersion("EXAMPLE-sparkVersion-Value")
			.driverShape("EXAMPLE-driverShape-Value")
			.executorShape("EXAMPLE-executorShape-Value")
			.totalExecutors(279).build())
		.configurationDetails(ConfigurationDetails.builder()
			.dataAsset(DataAssetFromOraclePeopleSoftDetails.builder()
				.host("EXAMPLE-host-Value")
				.port("EXAMPLE-port-Value")
				.serviceName("EXAMPLE-serviceName-Value")
				.driverClass("EXAMPLE-driverClass-Value")
				.sid("EXAMPLE-sid-Value")
				.walletSecret(SensitiveAttribute.builder()
					.secretConfig(OciVaultSecretConfig.builder()
						.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
					.value("EXAMPLE-value-Value").build())
				.walletPasswordSecret(SensitiveAttribute.builder()
					.secretConfig(OciVaultSecretConfig.builder()
						.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
					.value("EXAMPLE-value-Value").build())
				.defaultConnection(ConnectionFromOraclePeopleSoftDetails.builder()
					.username("EXAMPLE-username-Value")
					.password("EXAMPLE-password-Value")
					.passwordSecret(SensitiveAttribute.builder()
						.secretConfig(OciVaultSecretConfig.builder()
							.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
						.value("EXAMPLE-value-Value").build())
					.key("EXAMPLE-key-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value")
						.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
					.name("EXAMPLE-name-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(850)
					.objectStatus(977)
					.identifier("EXAMPLE-identifier-Value")
					.primarySchema(Schema.builder()
						.key("EXAMPLE-key-Value")
						.modelType("EXAMPLE-modelType-Value")
						.modelVersion("EXAMPLE-modelVersion-Value")
						.parentRef(ParentReference.builder()
							.parent("EXAMPLE-parent-Value")
							.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
						.name("EXAMPLE-name-Value")
						.resourceName("EXAMPLE-resourceName-Value")
						.description("EXAMPLE-description-Value")
						.objectVersion(503)
						.externalKey("EXAMPLE-externalKey-Value")
						.isHasContainers(true)
						.defaultConnection("EXAMPLE-defaultConnection-Value")
						.objectStatus(941)
						.identifier("EXAMPLE-identifier-Value")
						.metadata(ObjectMetadata.builder()
							.createdBy("EXAMPLE-createdBy-Value")
							.createdByName("EXAMPLE-createdByName-Value")
							.updatedBy("EXAMPLE-updatedBy-Value")
							.updatedByName("EXAMPLE-updatedByName-Value")
							.timeCreated(new Date("Sat Dec 30 17:36:07 UTC 2000"))
							.timeUpdated(new Date("Wed Aug 31 08:27:52 UTC 2011"))
							.aggregatorKey("EXAMPLE-aggregatorKey-Value")
							.aggregator(AggregatorSummary.builder()
								.type("EXAMPLE-type-Value")
								.key("EXAMPLE-key-Value")
								.name("EXAMPLE-name-Value")
								.identifier("EXAMPLE-identifier-Value")
								.description("EXAMPLE-description-Value").build())
							.identifierPath("EXAMPLE-identifierPath-Value")
							.infoFields(new HashMap<java.lang.String, java.lang.String>() {
									{
										put("EXAMPLE_KEY_DGgEa","EXAMPLE_VALUE_hxjZjYyjhSCMzarhiMyj");
									}
 								})
							.registryVersion(682)
							.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
							.isFavorite(false)
							.countStatistics(CountStatistic.builder()
								.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
										.objectType(CountStatisticSummary.ObjectType.DataAsset)
										.objectCount(745L).build()))).build()).build()).build())
					.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
							.name("EXAMPLE-name-Value")
							.value("EXAMPLE-value-Value").build())))
					.isDefault(false)
					.metadata(ObjectMetadata.builder()
						.createdBy("EXAMPLE-createdBy-Value")
						.createdByName("EXAMPLE-createdByName-Value")
						.updatedBy("EXAMPLE-updatedBy-Value")
						.updatedByName("EXAMPLE-updatedByName-Value")
						.timeCreated(new Date("Mon Nov 23 22:17:13 UTC 2026"))
						.timeUpdated(new Date("Wed Jun 02 09:28:43 UTC 2038"))
						.aggregatorKey("EXAMPLE-aggregatorKey-Value")
						.aggregator(AggregatorSummary.builder()
							.type("EXAMPLE-type-Value")
							.key("EXAMPLE-key-Value")
							.name("EXAMPLE-name-Value")
							.identifier("EXAMPLE-identifier-Value")
							.description("EXAMPLE-description-Value").build())
						.identifierPath("EXAMPLE-identifierPath-Value")
						.infoFields(new HashMap<java.lang.String, java.lang.String>() {
								{
									put("EXAMPLE_KEY_ENqcS","EXAMPLE_VALUE_duyt06luPrPKTMK7abwt");
								}
 							})
						.registryVersion(937)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.Project)
									.objectCount(309L).build()))).build()).build()).build())
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectStatus(780)
				.identifier("EXAMPLE-identifier-Value")
				.externalKey("EXAMPLE-externalKey-Value")
				.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_UldTZ","EXAMPLE_VALUE_UPNcLd38DQSUDjrLxCFb");
						}
 					})
				.nativeTypeSystem(TypeSystem.builder()
					.key("EXAMPLE-key-Value")
					.modelType("EXAMPLE-modelType-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value")
						.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
					.name("EXAMPLE-name-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(988)
					.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_iqF34","EXAMPLE_VALUE_GSHIHMzltZAB6fSK4iMz");
							}
 						})
					.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_I4IgU","EXAMPLE_VALUE_5L2KzUrwXXjPIjzN0BCb");
							}
 						})
					.objectStatus(454)
					.identifier("EXAMPLE-identifier-Value")
					.types(new ArrayList<>(Arrays.asList(DataType.builder()
							.dtType(DataType.DtType.Structured)
							.typeSystemName("EXAMPLE-typeSystemName-Value")
							.configDefinition(ConfigDefinition.builder()
								.key("EXAMPLE-key-Value")
								.modelType("EXAMPLE-modelType-Value")
								.modelVersion("EXAMPLE-modelVersion-Value")
								.parentRef(ParentReference.builder()
									.parent("EXAMPLE-parent-Value")
									.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
								.name("EXAMPLE-name-Value")
								.isContained(true)
								.objectStatus(910)
								.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
										{
											put("EXAMPLE_KEY_siebT",ConfigParameterDefinition.builder()
										.parameterType(MapType.builder()
											.keyElementType("EXAMPLE-keyElementType-Value")
											.valueElementType("EXAMPLE-valueElementType-Value")
											.containsNull(false)
											.key("EXAMPLE-key-Value")
											.modelVersion("EXAMPLE-modelVersion-Value")
											.parentRef(ParentReference.builder()
												.parent("EXAMPLE-parent-Value")
												.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
											.name("EXAMPLE-name-Value")
											.objectStatus(679)
											.description("EXAMPLE-description-Value").build())
										.parameterName("EXAMPLE-parameterName-Value")
										.description("EXAMPLE-description-Value")
										.defaultValue("EXAMPLE-defaultValue-Value")
										.classFieldName("EXAMPLE-classFieldName-Value")
										.isStatic(false)
										.isClassFieldValue(false).build());
										}
 									}).build())
							.key("EXAMPLE-key-Value")
							.modelVersion("EXAMPLE-modelVersion-Value")
							.parentRef(ParentReference.builder()
								.parent("EXAMPLE-parent-Value")
								.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
							.name("EXAMPLE-name-Value")
							.objectStatus(0)
							.description("EXAMPLE-description-Value").build()))).build())
				.objectVersion(394)
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value")
					.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
				.metadata(ObjectMetadata.builder()
					.createdBy("EXAMPLE-createdBy-Value")
					.createdByName("EXAMPLE-createdByName-Value")
					.updatedBy("EXAMPLE-updatedBy-Value")
					.updatedByName("EXAMPLE-updatedByName-Value")
					.timeCreated(new Date("Mon Sep 27 23:57:45 UTC 2049"))
					.timeUpdated(new Date("Thu Feb 03 02:49:57 UTC 2033"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.aggregator(AggregatorSummary.builder()
						.type("EXAMPLE-type-Value")
						.key("EXAMPLE-key-Value")
						.name("EXAMPLE-name-Value")
						.identifier("EXAMPLE-identifier-Value")
						.description("EXAMPLE-description-Value").build())
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_1DtXU","EXAMPLE_VALUE_jepnXfNRLB0R0Ljo4Sdf");
							}
 						})
					.registryVersion(210)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
								.objectCount(354L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_7rR5u","EXAMPLE_VALUE_xrteJI5IFTn1zVSlalIC");
						}
 					}).build())
			.connection(ConnectionFromJdbc.builder()
				.username("EXAMPLE-username-Value")
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value")
					.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectVersion(724)
				.objectStatus(224)
				.identifier("EXAMPLE-identifier-Value")
				.primarySchema(Schema.builder()
					.key("EXAMPLE-key-Value")
					.modelType("EXAMPLE-modelType-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value")
						.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
					.name("EXAMPLE-name-Value")
					.resourceName("EXAMPLE-resourceName-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(861)
					.externalKey("EXAMPLE-externalKey-Value")
					.isHasContainers(false)
					.defaultConnection("EXAMPLE-defaultConnection-Value")
					.objectStatus(94)
					.identifier("EXAMPLE-identifier-Value")
					.metadata(ObjectMetadata.builder()
						.createdBy("EXAMPLE-createdBy-Value")
						.createdByName("EXAMPLE-createdByName-Value")
						.updatedBy("EXAMPLE-updatedBy-Value")
						.updatedByName("EXAMPLE-updatedByName-Value")
						.timeCreated(new Date("Thu Mar 29 10:55:21 UTC 2035"))
						.timeUpdated(new Date("Sun Jan 17 11:02:53 UTC 2010"))
						.aggregatorKey("EXAMPLE-aggregatorKey-Value")
						.aggregator(AggregatorSummary.builder()
							.type("EXAMPLE-type-Value")
							.key("EXAMPLE-key-Value")
							.name("EXAMPLE-name-Value")
							.identifier("EXAMPLE-identifier-Value")
							.description("EXAMPLE-description-Value").build())
						.identifierPath("EXAMPLE-identifierPath-Value")
						.infoFields(new HashMap<java.lang.String, java.lang.String>() {
								{
									put("EXAMPLE_KEY_roWtQ","EXAMPLE_VALUE_HP9Bwp9hVBhZZgvISJE1");
								}
 							})
						.registryVersion(604)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.DataFlow)
									.objectCount(835L).build()))).build()).build()).build())
				.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
						.name("EXAMPLE-name-Value")
						.value("EXAMPLE-value-Value").build())))
				.isDefault(true)
				.metadata(ObjectMetadata.builder()
					.createdBy("EXAMPLE-createdBy-Value")
					.createdByName("EXAMPLE-createdByName-Value")
					.updatedBy("EXAMPLE-updatedBy-Value")
					.updatedByName("EXAMPLE-updatedByName-Value")
					.timeCreated(new Date("Tue Dec 15 08:40:29 UTC 2037"))
					.timeUpdated(new Date("Mon Jul 03 12:57:57 UTC 2028"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.aggregator(AggregatorSummary.builder()
						.type("EXAMPLE-type-Value")
						.key("EXAMPLE-key-Value")
						.name("EXAMPLE-name-Value")
						.identifier("EXAMPLE-identifier-Value")
						.description("EXAMPLE-description-Value").build())
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_vFZZy","EXAMPLE_VALUE_OZTqLHJvP9tKTsmtl9EF");
							}
 						})
					.registryVersion(482)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.DataFlow)
								.objectCount(128L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_5tR4w","EXAMPLE_VALUE_7srVeuL9WJtxU086t8VY");
						}
 					}).build())
			.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
			.schema(Schema.builder()
				.key("EXAMPLE-key-Value")
				.modelType("EXAMPLE-modelType-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value")
					.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
				.name("EXAMPLE-name-Value")
				.resourceName("EXAMPLE-resourceName-Value")
				.description("EXAMPLE-description-Value")
				.objectVersion(565)
				.externalKey("EXAMPLE-externalKey-Value")
				.isHasContainers(false)
				.defaultConnection("EXAMPLE-defaultConnection-Value")
				.objectStatus(774)
				.identifier("EXAMPLE-identifier-Value")
				.metadata(ObjectMetadata.builder()
					.createdBy("EXAMPLE-createdBy-Value")
					.createdByName("EXAMPLE-createdByName-Value")
					.updatedBy("EXAMPLE-updatedBy-Value")
					.updatedByName("EXAMPLE-updatedByName-Value")
					.timeCreated(new Date("Wed Oct 31 10:28:18 UTC 2035"))
					.timeUpdated(new Date("Mon Aug 03 13:55:56 UTC 2048"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.aggregator(AggregatorSummary.builder()
						.type("EXAMPLE-type-Value")
						.key("EXAMPLE-key-Value")
						.name("EXAMPLE-name-Value")
						.identifier("EXAMPLE-identifier-Value")
						.description("EXAMPLE-description-Value").build())
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_EQT2R","EXAMPLE_VALUE_NOtzdKrI0F14fi99pa5R");
							}
 						})
					.registryVersion(574)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.DataFlow)
								.objectCount(313L).build()))).build()).build()).build()).build()).build();

	UpdateExternalPublicationRequest updateExternalPublicationRequest = UpdateExternalPublicationRequest.builder()
		.workspaceId("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")
		.taskKey("EXAMPLE-taskKey-Value")
		.externalPublicationsKey("EXAMPLE-externalPublicationsKey-Value")
		.updateExternalPublicationDetails(updateExternalPublicationDetails)
		.opcRequestId("UNSLWS8LAHRWCZIVS8WO<unique_ID>")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

        /* Send request to the Client */
        UpdateExternalPublicationResponse response = client.updateExternalPublication(updateExternalPublicationRequest);
    }

    
}