/** 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(602).build())
		.configurationDetails(ConfigurationDetails.builder()
			.dataAsset(DataAssetFromFusionApp.builder()
				.serviceUrl("EXAMPLE-serviceUrl-Value")
				.defaultConnection(ConnectionFromBICCDetails.builder()
					.username("EXAMPLE-username-Value")
					.passwordSecret(SensitiveAttribute.builder()
						.secretConfig(OciVaultSecretConfig.builder()
							.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
						.value("EXAMPLE-value-Value").build())
					.defaultExternalStorage(ExternalStorage.builder()
						.storageId("ocid1.test.oc1..<unique_ID>EXAMPLE-storageId-Value")
						.storageName("EXAMPLE-storageName-Value")
						.host("EXAMPLE-host-Value")
						.tenancyId("ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value")
						.namespace("EXAMPLE-namespace-Value")
						.bucket("EXAMPLE-bucket-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(522)
					.objectStatus(123)
					.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(517)
						.externalKey("EXAMPLE-externalKey-Value")
						.isHasContainers(false)
						.defaultConnection("EXAMPLE-defaultConnection-Value")
						.objectStatus(718)
						.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("Fri Feb 26 06:04:52 UTC 2016"))
							.timeUpdated(new Date("Thu Jan 01 10:35:22 UTC 2043"))
							.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_GAzQS","EXAMPLE_VALUE_VSyVBYfwl2nvORaKSZTz");
									}
 								})
							.registryVersion(688)
							.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
							.isFavorite(true)
							.countStatistics(CountStatistic.builder()
								.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
										.objectType(CountStatisticSummary.ObjectType.Task)
										.objectCount(856L).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("Fri Oct 14 12:27:19 UTC 2033"))
						.timeUpdated(new Date("Sat Feb 24 02:31:11 UTC 2035"))
						.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_qSP7B","EXAMPLE_VALUE_qz1TZeQhcu9mg6kbcezO");
								}
 							})
						.registryVersion(133)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.DataFlow)
									.objectCount(353L).build()))).build()).build()).build())
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectStatus(225)
				.identifier("EXAMPLE-identifier-Value")
				.externalKey("EXAMPLE-externalKey-Value")
				.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_FNI2P","EXAMPLE_VALUE_ld9ZR3tnUzDYOLcCDHKW");
						}
 					})
				.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(174)
					.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_REV7E","EXAMPLE_VALUE_zpnOPnSBrXX73QrH4mee");
							}
 						})
					.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_aiPAK","EXAMPLE_VALUE_l0ZvgcSBqVPGW1ySIWLw");
							}
 						})
					.objectStatus(200)
					.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(697)
								.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
										{
											put("EXAMPLE_KEY_yOrBZ",ConfigParameterDefinition.builder()
										.parameterType(ConfiguredType.builder()
											.wrappedType("EXAMPLE-wrappedType-Value")
											.configValues(ConfigValues.builder()
												.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
														{
															put("EXAMPLE_KEY_J9tjv",ConfigParameterValue.builder()
														.stringValue("EXAMPLE-stringValue-Value")
														.intValue(764)
														.objectValue("EXAMPLE-objectValue-Value")
														.refValue("EXAMPLE-refValue-Value")
														.parameterValue("EXAMPLE-parameterValue-Value")
														.rootObjectValue("EXAMPLE-rootObjectValue-Value").build());
														}
 													})
												.parentRef(ParentReference.builder()
													.parent("EXAMPLE-parent-Value")
													.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").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(723)
											.description("EXAMPLE-description-Value").build())
										.parameterName("EXAMPLE-parameterName-Value")
										.description("EXAMPLE-description-Value")
										.defaultValue("EXAMPLE-defaultValue-Value")
										.classFieldName("EXAMPLE-classFieldName-Value")
										.isStatic(false)
										.isClassFieldValue(true).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(468)
							.description("EXAMPLE-description-Value").build()))).build())
				.objectVersion(887)
				.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("Thu May 24 00:11:40 UTC 2040"))
					.timeUpdated(new Date("Sat May 17 05:23:16 UTC 2008"))
					.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_Sp7Dh","EXAMPLE_VALUE_XIxuRG85t2GNaluWLNCw");
							}
 						})
					.registryVersion(147)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
								.objectCount(998L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_ZXgAt","EXAMPLE_VALUE_ZJNXmriHxcZHkr5DFcOR");
						}
 					}).build())
			.connection(ConnectionFromMySQL.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(586)
				.objectStatus(209)
				.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(311)
					.externalKey("EXAMPLE-externalKey-Value")
					.isHasContainers(true)
					.defaultConnection("EXAMPLE-defaultConnection-Value")
					.objectStatus(360)
					.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("Tue Dec 19 00:08:58 UTC 2000"))
						.timeUpdated(new Date("Tue Jul 15 20:43:47 UTC 2031"))
						.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_b7Ng0","EXAMPLE_VALUE_y9FjoBnAqnPJWi1e2x6U");
								}
 							})
						.registryVersion(609)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(false)
						.countStatistics(CountStatistic.builder()
							.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
									.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
									.objectCount(5L).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 Sep 11 14:32:04 UTC 2001"))
					.timeUpdated(new Date("Wed Dec 16 07:00:03 UTC 2037"))
					.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_u5MJ6","EXAMPLE_VALUE_5A5YG4oQ5As2RaEdAPcV");
							}
 						})
					.registryVersion(521)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(true)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.FunctionLibrary)
								.objectCount(66L).build()))).build()).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_vypH2","EXAMPLE_VALUE_szABfBwtzLF6GPfFGsHS");
						}
 					}).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(318)
				.externalKey("EXAMPLE-externalKey-Value")
				.isHasContainers(true)
				.defaultConnection("EXAMPLE-defaultConnection-Value")
				.objectStatus(158)
				.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("Fri Mar 21 22:45:41 UTC 2036"))
					.timeUpdated(new Date("Fri Feb 16 21:10:04 UTC 2035"))
					.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_L03YH","EXAMPLE_VALUE_3ZfxvmWnK7MsMOLHBM4w");
							}
 						})
					.registryVersion(236)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(true)
					.countStatistics(CountStatistic.builder()
						.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
								.objectType(CountStatisticSummary.ObjectType.Task)
								.objectCount(162L).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("LP9FWG2O44A4JVRMNUUB<unique_ID>")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

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

    
}