/** 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(678).build())
		.configurationDetails(ConfigurationDetails.builder()
			.dataAsset(DataAssetFromRestDetails.builder()
				.baseUrl("EXAMPLE-baseUrl-Value")
				.manifestFileContent("EXAMPLE-manifestFileContent-Value")
				.defaultConnection(ConnectionFromRestNoAuthDetails.builder()
					.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(202)
					.objectStatus(146)
					.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(769)
						.externalKey("EXAMPLE-externalKey-Value")
						.isHasContainers(false)
						.defaultConnection("EXAMPLE-defaultConnection-Value")
						.objectStatus(733)
						.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("Sun Sep 26 04:20:03 UTC 2032"))
							.timeUpdated(new Date("Tue Apr 01 20:15:36 UTC 2042"))
							.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_fsstb","EXAMPLE_VALUE_K0TaBPgdLRobIUB4nwsz");
									}
 								})
							.registryVersion(770)
							.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
							.isFavorite(false)
							.countStatistics(CountStatistic.builder()
								.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
										.objectType(CountStatisticSummary.ObjectType.Connection)
										.objectCount(959L).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("Sat Jun 16 18:32:51 UTC 2040"))
						.timeUpdated(new Date("Sun Oct 16 13:48:10 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_JQeQE","EXAMPLE_VALUE_BusCnxTe1IJTLCUOAYmb");
								}
 							})
						.registryVersion(736)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
									.objectCount(802L).build()))).build()).build()).build())
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectStatus(776)
				.identifier("EXAMPLE-identifier-Value")
				.externalKey("EXAMPLE-externalKey-Value")
				.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_g5Ag0","EXAMPLE_VALUE_3PzQm26LOanmfInmRQ0J");
						}
 					})
				.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(756)
					.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_AZof9","EXAMPLE_VALUE_fSk8vDuQMBXYM55HFT7o");
							}
 						})
					.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_2f8yI","EXAMPLE_VALUE_6FqMys327doVO2Xe1kb6");
							}
 						})
					.objectStatus(136)
					.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(false)
								.objectStatus(380)
								.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
										{
											put("EXAMPLE_KEY_UU7xL",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(471)
											.description("EXAMPLE-description-Value").build())
										.parameterName("EXAMPLE-parameterName-Value")
										.description("EXAMPLE-description-Value")
										.defaultValue("EXAMPLE-defaultValue-Value")
										.classFieldName("EXAMPLE-classFieldName-Value")
										.isStatic(true)
										.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(970)
							.description("EXAMPLE-description-Value").build()))).build())
				.objectVersion(74)
				.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("Sat Jun 11 16:04:51 UTC 2033"))
					.timeUpdated(new Date("Mon Mar 05 02:17:08 UTC 2018"))
					.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_ttvN9","EXAMPLE_VALUE_BqeEnr8VKcla9B825AP5");
							}
 						})
					.registryVersion(682)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(true)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
								.objectCount(216L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_M1IHx","EXAMPLE_VALUE_OVcHvxpYNaOf1LrW2vWO");
						}
 					}).build())
			.connection(ConnectionFromOraclePeopleSoft.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(559)
				.objectStatus(189)
				.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(934)
					.externalKey("EXAMPLE-externalKey-Value")
					.isHasContainers(true)
					.defaultConnection("EXAMPLE-defaultConnection-Value")
					.objectStatus(504)
					.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 Mar 21 08:55:09 UTC 2035"))
						.timeUpdated(new Date("Mon Feb 15 10:00:39 UTC 2049"))
						.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_q4SxM","EXAMPLE_VALUE_RemEkJ97eDGz8ArSfoMF");
								}
 							})
						.registryVersion(437)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(false)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
									.objectCount(584L).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("Tue Apr 24 12:20:50 UTC 2029"))
					.timeUpdated(new Date("Mon Nov 23 09:32:37 UTC 2015"))
					.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_IuylQ","EXAMPLE_VALUE_QNpgLD0WFroyoXvcSmAp");
							}
 						})
					.registryVersion(491)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.Folder)
								.objectCount(437L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_Dx8xo","EXAMPLE_VALUE_RnTl7w5V6McoH26wKxi6");
						}
 					}).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(163)
				.externalKey("EXAMPLE-externalKey-Value")
				.isHasContainers(false)
				.defaultConnection("EXAMPLE-defaultConnection-Value")
				.objectStatus(675)
				.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("Sun Nov 09 08:00:36 UTC 2031"))
					.timeUpdated(new Date("Tue Nov 27 04:34:05 UTC 2046"))
					.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_jfCvO","EXAMPLE_VALUE_gNGXYF2GtJWGc03XDcKY");
							}
 						})
					.registryVersion(533)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.DataAsset)
								.objectCount(335L).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("VNUHTGMJZHY7H0MDYYUQ<unique_ID>")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

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

    
}