/** 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 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 = new DataIntegrationClient(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(39)
		.externalKey("EXAMPLE-externalKey-Value")
		.shape(Shape.builder()
			.type(DynamicType.builder()
				.typeHandler(RuleTypeConfig.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())
					.scope("EXAMPLE-scope-Value")
					.isOrderByRule(true)
					.projectionRules(new ArrayList<>(Arrays.asList(TypeListRule.builder()
							.isSkipRemainingRulesOnMatch(true)
							.scope("EXAMPLE-scope-Value")
							.isCascade(true)
							.matchingStrategy(TypeListRule.MatchingStrategy.NameOrTags)
							.isCaseSensitive(false)
							.ruleType(TypeListRule.RuleType.Exclude)
							.types(new ArrayList<>(Arrays.asList("EXAMPLE-types-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())
							.isJavaRegexSyntax(false)
							.configValues(ConfigValues.builder()
								.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
										{
											put("EXAMPLE_KEY_IcG7r",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(331)
										.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(345)
							.description("EXAMPLE-description-Value").build())))
					.configValues(ConfigValues.builder()
						.configParamValues(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterValue>() {
								{
									put("EXAMPLE_KEY_Ndsc8",ConfigParameterValue.builder()
								.stringValue("EXAMPLE-stringValue-Value")
								.intValue(924)
								.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(28).build())
				.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(770)
					.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
							{
								put("EXAMPLE_KEY_YHvOV",ConfigParameterDefinition.builder()
							.parameterName("EXAMPLE-parameterName-Value")
							.description("EXAMPLE-description-Value")
							.defaultValue("EXAMPLE-defaultValue-Value")
							.classFieldName("EXAMPLE-classFieldName-Value")
							.isStatic(true)
							.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(44)
				.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_np7Or",ConfigParameterValue.builder()
						.stringValue("EXAMPLE-stringValue-Value")
						.intValue(877)
						.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(560)
			.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(945)
			.types(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.DerivedType>() {
					{
						put("EXAMPLE_KEY_xj9ee",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(900)
					.description("EXAMPLE-description-Value").build());
					}
 				})
			.objectStatus(766)
			.identifier("EXAMPLE-identifier-Value").build())
		.entityType(CreateEntityShapeFromFile.EntityType.Table)
		.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(279)
						.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_KVfPz",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(427)
											.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(336)
								.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_xxdTS",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(488)
										.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(223)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build()).build())))
				.objectStatus(993).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(152)
						.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_Q8DR2",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(71)
											.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(451)
								.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_UFnZK",ConfigParameterValue.builder()
										.stringValue("EXAMPLE-stringValue-Value")
										.intValue(586)
										.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(230)
							.name("EXAMPLE-name-Value")
							.description("EXAMPLE-description-Value").build()).build())))
				.updateRule(127)
				.deleteRule(540)
				.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(923)
							.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_EhNvP",ConfigParameterValue.builder()
												.stringValue("EXAMPLE-stringValue-Value")
												.intValue(739)
												.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(824)
									.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_kkIxs",ConfigParameterValue.builder()
											.stringValue("EXAMPLE-stringValue-Value")
											.intValue(730)
											.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(847)
								.name("EXAMPLE-name-Value")
								.description("EXAMPLE-description-Value").build()).build())))
					.objectStatus(915).build())
				.objectStatus(921).build())))
		.resourceName("EXAMPLE-resourceName-Value")
		.dataFormat(DataFormat.builder()
			.formatAttribute(AvroFormatAttribute.builder()
				.compression("EXAMPLE-compression-Value")
				.isFilePattern(false).build())
			.type(DataFormat.Type.Avro)
			.compressionConfig(Compression.builder()
				.codec(Compression.Codec.Snappy).build()).build())
		.objectStatus(605)
		.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("BUQLL7KRQTAC5QB1TIGV<unique_ID>")
		.opcRetryToken("EXAMPLE-opcRetryToken-Value")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

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

    
}