/** 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 CreateEntityShapeExample {
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). */
CreateEntityShapeDetails createEntityShapeDetails = CreateEntityShapeFromFile.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(664)
.externalKey("EXAMPLE-externalKey-Value")
.shape(Shape.builder()
.type(ArrayType.builder()
.elementType("EXAMPLE-elementType-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")
.objectStatus(109)
.description("EXAMPLE-description-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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_SVobH",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(436)
.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())
.objectStatus(636)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build())
.shapeId("ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value")
.types(TypeLibrary.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(159)
.types(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.DerivedType>() {
{
put("EXAMPLE_KEY_M3sh8",DerivedType.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")
.objectStatus(95)
.description("EXAMPLE-description-Value").build());
}
})
.objectStatus(305)
.identifier("EXAMPLE-identifier-Value").build())
.entityType(CreateEntityShapeFromFile.EntityType.Stream)
.otherTypeLabel("EXAMPLE-otherTypeLabel-Value")
.uniqueKeys(new ArrayList<>(Arrays.asList(PrimaryKey.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")
.attributeRefs(new ArrayList<>(Arrays.asList(KeyAttribute.builder()
.position(235)
.shapeField(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_EQEPu",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(695)
.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())
.position(702)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(false).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_sbSyO",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(381)
.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())
.objectStatus(179)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build())
.attribute(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_RRHKP",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(443)
.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())
.position(1)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(false).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_NiD9y",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(78)
.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())
.objectStatus(961)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build()).build())))
.objectStatus(799).build())))
.foreignKeys(new ArrayList<>(Arrays.asList(ForeignKey.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")
.attributeRefs(new ArrayList<>(Arrays.asList(KeyAttribute.builder()
.position(496)
.shapeField(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_HSAjM",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(571)
.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())
.position(422)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(false).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_zYZsv",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(510)
.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())
.objectStatus(736)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build())
.attribute(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_b0tP7",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(794)
.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())
.position(521)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(false).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_6ZOF1",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(473)
.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())
.objectStatus(96)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build()).build())))
.updateRule(85)
.deleteRule(845)
.referenceUniqueKey(PrimaryKey.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")
.attributeRefs(new ArrayList<>(Arrays.asList(KeyAttribute.builder()
.position(266)
.shapeField(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_HtxoJ",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(203)
.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())
.position(731)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(true).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_7GTvK",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(980)
.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())
.objectStatus(101)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build())
.attribute(ShapeField.builder()
.type("EXAMPLE-type-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.nativeShapeField(NativeShapeField.builder()
.name("EXAMPLE-name-Value")
.modelType("EXAMPLE-modelType-Value")
.type("EXAMPLE-type-Value")
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_MB5Jp",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(446)
.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())
.position(239)
.defaultValueString("EXAMPLE-defaultValueString-Value")
.isMandatory(true).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())
.configValues(ConfigValues.builder()
.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
{
put("EXAMPLE_KEY_F2CEY",ConfigParameterValue.builder()
.stringValue("EXAMPLE-stringValue-Value")
.intValue(328)
.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())
.objectStatus(579)
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value").build()).build())))
.objectStatus(938).build())
.objectStatus(527).build())))
.resourceName("EXAMPLE-resourceName-Value")
.dataFormat(DataFormat.builder()
.formatAttribute(AvroFormatAttribute.builder()
.compression("EXAMPLE-compression-Value")
.isFilePattern(true).build())
.type(DataFormat.Type.Parquet)
.compressionConfig(Compression.builder()
.codec(Compression.Codec.Auto).build()).build())
.objectStatus(335)
.identifier("EXAMPLE-identifier-Value").build();
CreateEntityShapeRequest createEntityShapeRequest = CreateEntityShapeRequest.builder()
.workspaceId("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")
.connectionKey("EXAMPLE-connectionKey-Value")
.schemaResourceName("EXAMPLE-schemaResourceName-Value")
.createEntityShapeDetails(createEntityShapeDetails)
.opcRequestId("H3LQLHOINAVBXVFFFI6G<unique_ID>")
.opcRetryToken("EXAMPLE-opcRetryToken-Value")
.ifMatch("EXAMPLE-ifMatch-Value").build();
/* Send request to the Client */
CreateEntityShapeResponse response = client.createEntityShape(createEntityShapeRequest);
}
}