/** 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.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 = new DataIntegrationClient(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(68).build())
		.configurationDetails(ConfigurationDetails.builder()
			.dataAsset(DataAssetFromOracleDetails.builder()
				.host("EXAMPLE-host-Value")
				.port("EXAMPLE-port-Value")
				.serviceName("EXAMPLE-serviceName-Value")
				.driverClass("EXAMPLE-driverClass-Value")
				.sid("EXAMPLE-sid-Value")
				.credentialFileContent("EXAMPLE-credentialFileContent-Value")
				.defaultConnection(ConnectionFromOracleDetails.builder()
					.username("EXAMPLE-username-Value")
					.password("EXAMPLE-password-Value")
					.key("EXAMPLE-key-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value").build())
					.name("EXAMPLE-name-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(149)
					.objectStatus(971)
					.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").build())
						.name("EXAMPLE-name-Value")
						.resourceName("EXAMPLE-resourceName-Value")
						.description("EXAMPLE-description-Value")
						.objectVersion(466)
						.externalKey("EXAMPLE-externalKey-Value")
						.isHasContainers(true)
						.defaultConnection("EXAMPLE-defaultConnection-Value")
						.objectStatus(838)
						.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 16 03:39:13 UTC 2018"))
							.timeUpdated(new Date("Fri Feb 21 19:24:21 UTC 2031"))
							.aggregatorKey("EXAMPLE-aggregatorKey-Value")
							.identifierPath("EXAMPLE-identifierPath-Value")
							.infoFields(new HashMap<java.lang.String, java.lang.String>() {
									{
										put("EXAMPLE_KEY_PDlvf","EXAMPLE_VALUE_HcYddKjFPESSbB3d3nt6");
									}
 								})
							.registryVersion(565)
							.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
							.isFavorite(true).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 02 11:37:12 UTC 2036"))
						.timeUpdated(new Date("Tue Jun 03 21:47:31 UTC 2008"))
						.aggregatorKey("EXAMPLE-aggregatorKey-Value")
						.identifierPath("EXAMPLE-identifierPath-Value")
						.infoFields(new HashMap<java.lang.String, java.lang.String>() {
								{
									put("EXAMPLE_KEY_QB5br","EXAMPLE_VALUE_fIheewu0YaK2DuKlLaTo");
								}
 							})
						.registryVersion(229)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true).build()).build())
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectStatus(332)
				.identifier("EXAMPLE-identifier-Value")
				.externalKey("EXAMPLE-externalKey-Value")
				.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_hiFeJ","EXAMPLE_VALUE_lnnKy8S4rvkt9R84tIuT");
						}
 					})
				.nativeTypeSystem(TypeSystem.builder()
					.key("EXAMPLE-key-Value")
					.modelType("EXAMPLE-modelType-Value")
					.modelVersion("EXAMPLE-modelVersion-Value")
					.parentRef(ParentReference.builder()
						.parent("EXAMPLE-parent-Value").build())
					.name("EXAMPLE-name-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(506)
					.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_v5VYF","EXAMPLE_VALUE_avZoS5uXoNNIeiOHPDwO");
							}
 						})
					.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_tl9n4","EXAMPLE_VALUE_Aa0JyDGIVzFWmvdiOeiu");
							}
 						})
					.objectStatus(345)
					.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").build())
								.name("EXAMPLE-name-Value")
								.isContained(true)
								.objectStatus(508)
								.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
										{
											put("EXAMPLE_KEY_P4FYA",ConfigParameterDefinition.builder()
										.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").build())
							.name("EXAMPLE-name-Value")
							.objectStatus(168)
							.description("EXAMPLE-description-Value").build()))).build())
				.objectVersion(194)
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value").build())
				.metadata(ObjectMetadata.builder()
					.createdBy("EXAMPLE-createdBy-Value")
					.createdByName("EXAMPLE-createdByName-Value")
					.updatedBy("EXAMPLE-updatedBy-Value")
					.updatedByName("EXAMPLE-updatedByName-Value")
					.timeCreated(new Date("Fri Oct 02 19:45:54 UTC 2026"))
					.timeUpdated(new Date("Sun Jun 10 19:57:27 UTC 2040"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_xTFj6","EXAMPLE_VALUE_IgADlV8ztR2LQ1lnSC3p");
							}
 						})
					.registryVersion(28)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(true).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_v26z2","EXAMPLE_VALUE_Q6QWzS3TtHCPpYbUwMRY");
						}
 					}).build())
			.connection(ConnectionFromOracle.builder()
				.username("EXAMPLE-username-Value")
				.password("EXAMPLE-password-Value")
				.key("EXAMPLE-key-Value")
				.modelVersion("EXAMPLE-modelVersion-Value")
				.parentRef(ParentReference.builder()
					.parent("EXAMPLE-parent-Value").build())
				.name("EXAMPLE-name-Value")
				.description("EXAMPLE-description-Value")
				.objectVersion(124)
				.objectStatus(953)
				.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").build())
					.name("EXAMPLE-name-Value")
					.resourceName("EXAMPLE-resourceName-Value")
					.description("EXAMPLE-description-Value")
					.objectVersion(241)
					.externalKey("EXAMPLE-externalKey-Value")
					.isHasContainers(false)
					.defaultConnection("EXAMPLE-defaultConnection-Value")
					.objectStatus(314)
					.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 Mar 15 12:30:04 UTC 2022"))
						.timeUpdated(new Date("Wed Apr 10 21:58:18 UTC 2041"))
						.aggregatorKey("EXAMPLE-aggregatorKey-Value")
						.identifierPath("EXAMPLE-identifierPath-Value")
						.infoFields(new HashMap<java.lang.String, java.lang.String>() {
								{
									put("EXAMPLE_KEY_b8Gqk","EXAMPLE_VALUE_D6WiUOL26IXweqYDyhuv");
								}
 							})
						.registryVersion(324)
						.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
						.isFavorite(true).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 Feb 25 19:53:24 UTC 2041"))
					.timeUpdated(new Date("Wed Oct 20 11:25:39 UTC 2021"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_cHody","EXAMPLE_VALUE_Fnf9DBsiEX5abNnYOgt8");
							}
 						})
					.registryVersion(298)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(false).build())
				.keyMap(new HashMap<java.lang.String, java.lang.String>() {
						{
							put("EXAMPLE_KEY_cMq7t","EXAMPLE_VALUE_8aSM8GxJ6ECL2ZqZMmvp");
						}
 					}).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").build())
				.name("EXAMPLE-name-Value")
				.resourceName("EXAMPLE-resourceName-Value")
				.description("EXAMPLE-description-Value")
				.objectVersion(463)
				.externalKey("EXAMPLE-externalKey-Value")
				.isHasContainers(false)
				.defaultConnection("EXAMPLE-defaultConnection-Value")
				.objectStatus(76)
				.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 Jan 11 06:49:32 UTC 2002"))
					.timeUpdated(new Date("Tue Oct 26 13:06:26 UTC 2032"))
					.aggregatorKey("EXAMPLE-aggregatorKey-Value")
					.identifierPath("EXAMPLE-identifierPath-Value")
					.infoFields(new HashMap<java.lang.String, java.lang.String>() {
							{
								put("EXAMPLE_KEY_FgXok","EXAMPLE_VALUE_N55jOf7k01DgISAhLJ7t");
							}
 						})
					.registryVersion(906)
					.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
					.isFavorite(true).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("ZR7K8WOYSACGIBZCENZ7/OpcRequestIdExample/<unique_ID>")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

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

    
}