/** 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 = CreateEntityShapeFromObject.builder()
		.key("EXAMPLE-key-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")
		.externalKey("EXAMPLE-externalKey-Value")
		.shape(Shape.builder()
			.type(CompositeType.builder()
				.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(697)
					.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
							{
								put("EXAMPLE_KEY_KcSkn",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(356)
				.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_IPDZz",ConfigParameterValue.builder()
						.stringValue("EXAMPLE-stringValue-Value")
						.intValue(975)
						.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(955)
			.name("EXAMPLE-name-Value")
			.description("EXAMPLE-description-Value").build())
		.shapeId("ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value")
		.entityType(CreateEntityShapeFromObject.EntityType.File)
		.otherTypeLabel("EXAMPLE-otherTypeLabel-Value")
		.uniqueKeys(new ArrayList<>(Arrays.asList(UniqueDataKey.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(798)
						.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_WC4gy",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(275)
											.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(396)
								.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_dacuS",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(81)
										.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(34)
							.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_j7oBZ",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(366)
											.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(129)
								.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_i5jPx",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(107)
										.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(166)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build()).build())))
				.objectStatus(496).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(9)
						.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_OULVB",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(158)
											.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(75)
								.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_0KxY0",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(11)
										.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(187)
							.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_HmjWw",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(37)
											.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(252)
								.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_vWyut",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(954)
										.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(427)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build()).build())))
				.updateRule(294)
				.deleteRule(875)
				.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(631)
							.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_q2W4A",ConfigParameterValue.builder()
												.stringValue("EXAMPLE-stringValue-Value")
												.intValue(548)
												.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(186)
									.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_AEQSk",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(987)
											.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(489)
								.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_KYo5q",ConfigParameterValue.builder()
												.stringValue("EXAMPLE-stringValue-Value")
												.intValue(852)
												.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(886)
									.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_0FJZC",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(11)
											.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(284)
								.name("EXAMPLE-name-Value")
								.description("EXAMPLE-description-Value").build()).build())))
					.objectStatus(982).build())
				.objectStatus(120).build())))
		.resourceName("EXAMPLE-resourceName-Value")
		.dataFormat(DataFormat.builder()
			.formatAttribute(JsonFormatAttribute.builder()
				.encoding("EXAMPLE-encoding-Value")
				.sampleEntityData("EXAMPLE-sampleEntityData-Value")
				.isFilePattern(true).build())
			.type(DataFormat.Type.Parquet)
			.compressionConfig(Compression.builder()
				.codec(Compression.Codec.Bzip2).build()).build())
		.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("L1L5FUQP03VXGZOQTR4L<unique_ID>")
		.opcRetryToken("EXAMPLE-opcRetryToken-Value")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

        /* Send request to the Client */
        CreateEntityShapeResponse response = client.createEntityShape(createEntityShapeRequest);
    }

    
}