/** 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(223).build())
.configurationDetails(ConfigurationDetails.builder()
.dataAsset(DataAssetFromOracleSiebelDetails.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(ConnectionFromOracleSiebelDetails.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(880)
.objectStatus(935)
.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(712)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(true)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(86)
.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("Mon Sep 25 19:23:01 UTC 2034"))
.timeUpdated(new Date("Sun Nov 19 06:48:36 UTC 2045"))
.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_J8rwR","EXAMPLE_VALUE_zLUH6GRP1Oi4vw6JpH7D");
}
})
.registryVersion(685)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
.objectCount(512L).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("Thu May 02 17:34:57 UTC 2041"))
.timeUpdated(new Date("Tue May 15 02:37:03 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_ebxMM","EXAMPLE_VALUE_5sxS0IPy4ralRmj6TdF7");
}
})
.registryVersion(492)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.FunctionLibrary)
.objectCount(17L).build()))).build()).build()).build())
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectStatus(630)
.identifier("EXAMPLE-identifier-Value")
.externalKey("EXAMPLE-externalKey-Value")
.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_Umo5b","EXAMPLE_VALUE_y1VzEAUpznB0tGuYYpbU");
}
})
.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(94)
.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_6sOf0","EXAMPLE_VALUE_mbC1OGCabvwURYmeQ3pU");
}
})
.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_gWour","EXAMPLE_VALUE_DTeqANkAz2IENFwiZKUJ");
}
})
.objectStatus(408)
.identifier("EXAMPLE-identifier-Value")
.types(new ArrayList<>(Arrays.asList(DataType.builder()
.dtType(DataType.DtType.Primitive)
.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(546)
.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
{
put("EXAMPLE_KEY_3eGtb",ConfigParameterDefinition.builder()
.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(503)
.description("EXAMPLE-description-Value").build()))).build())
.objectVersion(460)
.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("Wed Aug 31 14:43:21 UTC 2033"))
.timeUpdated(new Date("Tue Jul 26 18:28:15 UTC 2005"))
.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_YkZWU","EXAMPLE_VALUE_d8JiBFxV1FzYRLVbHkpL");
}
})
.registryVersion(93)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Project)
.objectCount(105L).build()))).build()).build())
.keyMap(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_9txgP","EXAMPLE_VALUE_A38txtkv4Apf5fnxbmt7");
}
}).build())
.connection(ConnectionFromOracleSiebel.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(148)
.objectStatus(841)
.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(693)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(true)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(951)
.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 Nov 16 20:02:19 UTC 2005"))
.timeUpdated(new Date("Mon Nov 11 13:34:40 UTC 2047"))
.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_xdthS","EXAMPLE_VALUE_N3DL2qHoORPlLp0vTgY6");
}
})
.registryVersion(831)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
.objectCount(911L).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("Sun Mar 12 17:12:52 UTC 2028"))
.timeUpdated(new Date("Mon Jan 22 00:06:51 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_xB8Af","EXAMPLE_VALUE_1WuLc03oJ0TifHe6nnR4");
}
})
.registryVersion(914)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Task)
.objectCount(702L).build()))).build()).build())
.keyMap(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_qcqls","EXAMPLE_VALUE_IkQd0Dh77DQLKWuEvIAY");
}
}).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(207)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(false)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(107)
.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("Mon Dec 25 16:38:41 UTC 2017"))
.timeUpdated(new Date("Thu May 05 23:42:51 UTC 2022"))
.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_rKeko","EXAMPLE_VALUE_mMERYwgDOVff5bFZupMq");
}
})
.registryVersion(732)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.FunctionLibrary)
.objectCount(97L).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("J99E6SZEGH9HWMNYC46N<unique_ID>")
.ifMatch("EXAMPLE-ifMatch-Value").build();
/* Send request to the Client */
UpdateExternalPublicationResponse response = client.updateExternalPublication(updateExternalPublicationRequest);
}
}