// 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 * as dataintegration from "oci-dataintegration";
import common = require("oci-common");

// 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.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
  try {
    // Create a service client
    const client = new dataintegration.DataIntegrationClient({
      authenticationDetailsProvider: provider
    });

    // Create a request and dependent object(s).
    const createEntityShapeDetails = ({
      modelType: "OBJECT_ENTITY",
      key: "EXAMPLE-key-Value",
      parentRef: ({
        parent: "EXAMPLE-parent-Value",
        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
      } as unknown) as dataintegration.models.ParentReference,
      name: "EXAMPLE-name-Value",
      description: "EXAMPLE-description-Value",
      externalKey: "EXAMPLE-externalKey-Value",
      shape: ({
        modelType: "SHAPE",
        type: ({
          modelType: "MAP_TYPE",
          keyElementType: "EXAMPLE-keyElementType-Value",
          valueElementType: "EXAMPLE-valueElementType-Value",
          containsNull: true,
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: ({
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          } as unknown) as dataintegration.models.ParentReference,
          name: "EXAMPLE-name-Value",
          objectStatus: 663,
          description: "EXAMPLE-description-Value"
        } as unknown) as dataintegration.models.MapType,
        key: "EXAMPLE-key-Value",
        modelVersion: "EXAMPLE-modelVersion-Value",
        parentRef: ({
          parent: "EXAMPLE-parent-Value",
          rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
        } as unknown) as dataintegration.models.ParentReference,
        configValues: ({
          configParamValues: {
            EXAMPLE_KEY_5FJ1B: ({
              stringValue: "EXAMPLE-stringValue-Value",
              intValue: 293,
              objectValue: "EXAMPLE-objectValue-Value",
              refValue: "EXAMPLE-refValue-Value",
              parameterValue: "EXAMPLE-parameterValue-Value",
              rootObjectValue: "EXAMPLE-rootObjectValue-Value"
            } as unknown) as dataintegration.models.ConfigParameterValue
          },
          parentRef: ({
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          } as unknown) as dataintegration.models.ParentReference
        } as unknown) as dataintegration.models.ConfigValues,
        objectStatus: 212,
        name: "EXAMPLE-name-Value",
        description: "EXAMPLE-description-Value"
      } as unknown) as dataintegration.models.Shape,
      shapeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value",
      entityType: dataintegration.models.CreateEntityShapeFromObject.EntityType.View,
      otherTypeLabel: "EXAMPLE-otherTypeLabel-Value",
      uniqueKeys: [
        ({
          modelType: "UNIQUE_KEY",
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: ({
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          } as unknown) as dataintegration.models.ParentReference,
          name: "EXAMPLE-name-Value",
          attributeRefs: [
            ({
              position: 800,
              shapeField: ({
                modelType: "SHAPE_FIELD",
                type: "EXAMPLE-type-Value",
                labels: ["EXAMPLE--Value"],
                nativeShapeField: ({
                  name: "EXAMPLE-name-Value",
                  modelType: "EXAMPLE-modelType-Value",
                  type: "EXAMPLE-type-Value",
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_QYJyw: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 973,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  position: 66,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: false
                } as unknown) as dataintegration.models.NativeShapeField,
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: ({
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                } as unknown) as dataintegration.models.ParentReference,
                configValues: ({
                  configParamValues: {
                    EXAMPLE_KEY_psFoj: ({
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 34,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    } as unknown) as dataintegration.models.ConfigParameterValue
                  },
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference
                } as unknown) as dataintegration.models.ConfigValues,
                objectStatus: 336,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              } as unknown) as dataintegration.models.ShapeField,
              attribute: ({
                modelType: "SHAPE_FIELD",
                type: "EXAMPLE-type-Value",
                labels: ["EXAMPLE--Value"],
                nativeShapeField: ({
                  name: "EXAMPLE-name-Value",
                  modelType: "EXAMPLE-modelType-Value",
                  type: "EXAMPLE-type-Value",
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_rj6bv: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 394,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  position: 264,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: true
                } as unknown) as dataintegration.models.NativeShapeField,
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: ({
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                } as unknown) as dataintegration.models.ParentReference,
                configValues: ({
                  configParamValues: {
                    EXAMPLE_KEY_Pd5so: ({
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 241,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    } as unknown) as dataintegration.models.ConfigParameterValue
                  },
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference
                } as unknown) as dataintegration.models.ConfigValues,
                objectStatus: 128,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              } as unknown) as dataintegration.models.ShapeField
            } as unknown) as dataintegration.models.KeyAttribute
          ],
          objectStatus: 82
        } as unknown) as dataintegration.models.UniqueDataKey
      ],
      foreignKeys: [
        ({
          modelType: "FOREIGN_KEY",
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: ({
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          } as unknown) as dataintegration.models.ParentReference,
          name: "EXAMPLE-name-Value",
          attributeRefs: [
            ({
              position: 592,
              shapeField: ({
                modelType: "SHAPE_FIELD",
                type: "EXAMPLE-type-Value",
                labels: ["EXAMPLE--Value"],
                nativeShapeField: ({
                  name: "EXAMPLE-name-Value",
                  modelType: "EXAMPLE-modelType-Value",
                  type: "EXAMPLE-type-Value",
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_eehyc: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 313,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  position: 678,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: false
                } as unknown) as dataintegration.models.NativeShapeField,
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: ({
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                } as unknown) as dataintegration.models.ParentReference,
                configValues: ({
                  configParamValues: {
                    EXAMPLE_KEY_Po4so: ({
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 765,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    } as unknown) as dataintegration.models.ConfigParameterValue
                  },
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference
                } as unknown) as dataintegration.models.ConfigValues,
                objectStatus: 487,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              } as unknown) as dataintegration.models.ShapeField,
              attribute: ({
                modelType: "SHAPE_FIELD",
                type: "EXAMPLE-type-Value",
                labels: ["EXAMPLE--Value"],
                nativeShapeField: ({
                  name: "EXAMPLE-name-Value",
                  modelType: "EXAMPLE-modelType-Value",
                  type: "EXAMPLE-type-Value",
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_kBG7e: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 918,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  position: 878,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: true
                } as unknown) as dataintegration.models.NativeShapeField,
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: ({
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                } as unknown) as dataintegration.models.ParentReference,
                configValues: ({
                  configParamValues: {
                    EXAMPLE_KEY_y1fDG: ({
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 427,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    } as unknown) as dataintegration.models.ConfigParameterValue
                  },
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference
                } as unknown) as dataintegration.models.ConfigValues,
                objectStatus: 183,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              } as unknown) as dataintegration.models.ShapeField
            } as unknown) as dataintegration.models.KeyAttribute
          ],
          updateRule: 441,
          deleteRule: 316,
          referenceUniqueKey: ({
            modelType: "PRIMARY_KEY",
            key: "EXAMPLE-key-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: ({
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            } as unknown) as dataintegration.models.ParentReference,
            name: "EXAMPLE-name-Value",
            attributeRefs: [
              ({
                position: 206,
                shapeField: ({
                  modelType: "SHAPE_FIELD",
                  type: "EXAMPLE-type-Value",
                  labels: ["EXAMPLE--Value"],
                  nativeShapeField: ({
                    name: "EXAMPLE-name-Value",
                    modelType: "EXAMPLE-modelType-Value",
                    type: "EXAMPLE-type-Value",
                    configValues: ({
                      configParamValues: {
                        EXAMPLE_KEY_qzEXt: ({
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 602,
                          objectValue: "EXAMPLE-objectValue-Value",
                          refValue: "EXAMPLE-refValue-Value",
                          parameterValue: "EXAMPLE-parameterValue-Value",
                          rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                        } as unknown) as dataintegration.models.ConfigParameterValue
                      },
                      parentRef: ({
                        parent: "EXAMPLE-parent-Value",
                        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                      } as unknown) as dataintegration.models.ParentReference
                    } as unknown) as dataintegration.models.ConfigValues,
                    position: 571,
                    defaultValueString: "EXAMPLE-defaultValueString-Value",
                    isMandatory: true
                  } as unknown) as dataintegration.models.NativeShapeField,
                  key: "EXAMPLE-key-Value",
                  modelVersion: "EXAMPLE-modelVersion-Value",
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference,
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_eobiP: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 420,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  objectStatus: 930,
                  name: "EXAMPLE-name-Value",
                  description: "EXAMPLE-description-Value"
                } as unknown) as dataintegration.models.ShapeField,
                attribute: ({
                  modelType: "SHAPE_FIELD",
                  type: "EXAMPLE-type-Value",
                  labels: ["EXAMPLE--Value"],
                  nativeShapeField: ({
                    name: "EXAMPLE-name-Value",
                    modelType: "EXAMPLE-modelType-Value",
                    type: "EXAMPLE-type-Value",
                    configValues: ({
                      configParamValues: {
                        EXAMPLE_KEY_TMp1q: ({
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 452,
                          objectValue: "EXAMPLE-objectValue-Value",
                          refValue: "EXAMPLE-refValue-Value",
                          parameterValue: "EXAMPLE-parameterValue-Value",
                          rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                        } as unknown) as dataintegration.models.ConfigParameterValue
                      },
                      parentRef: ({
                        parent: "EXAMPLE-parent-Value",
                        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                      } as unknown) as dataintegration.models.ParentReference
                    } as unknown) as dataintegration.models.ConfigValues,
                    position: 663,
                    defaultValueString: "EXAMPLE-defaultValueString-Value",
                    isMandatory: false
                  } as unknown) as dataintegration.models.NativeShapeField,
                  key: "EXAMPLE-key-Value",
                  modelVersion: "EXAMPLE-modelVersion-Value",
                  parentRef: ({
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  } as unknown) as dataintegration.models.ParentReference,
                  configValues: ({
                    configParamValues: {
                      EXAMPLE_KEY_o1GYT: ({
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 835,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      } as unknown) as dataintegration.models.ConfigParameterValue
                    },
                    parentRef: ({
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    } as unknown) as dataintegration.models.ParentReference
                  } as unknown) as dataintegration.models.ConfigValues,
                  objectStatus: 61,
                  name: "EXAMPLE-name-Value",
                  description: "EXAMPLE-description-Value"
                } as unknown) as dataintegration.models.ShapeField
              } as unknown) as dataintegration.models.KeyAttribute
            ],
            objectStatus: 717
          } as unknown) as dataintegration.models.PrimaryKey,
          objectStatus: 99
        } as unknown) as dataintegration.models.ForeignKey
      ],
      resourceName: "EXAMPLE-resourceName-Value",
      dataFormat: ({
        formatAttribute: ({
          modelType: "PARQUET_FORMAT",
          compression: "EXAMPLE-compression-Value",
          isFilePattern: false
        } as unknown) as dataintegration.models.ParquetFormatAttribute,
        type: dataintegration.models.DataFormat.Type.Json,
        compressionConfig: ({
          codec: dataintegration.models.Compression.Codec.Gzip
        } as unknown) as dataintegration.models.Compression
      } as unknown) as dataintegration.models.DataFormat,
      identifier: "EXAMPLE-identifier-Value"
    } as unknown) as dataintegration.models.CreateEntityShapeFromObject;

    const createEntityShapeRequest: dataintegration.requests.CreateEntityShapeRequest = {
      workspaceId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
      connectionKey: "EXAMPLE-connectionKey-Value",
      schemaResourceName: "EXAMPLE-schemaResourceName-Value",
      createEntityShapeDetails: createEntityShapeDetails,
      opcRequestId: "JQASX5NJZDYYW4Y37YMV<unique_ID>",
      opcRetryToken: "EXAMPLE-opcRetryToken-Value",
      ifMatch: "EXAMPLE-ifMatch-Value"
    };

    // Send request to the Client.
    const createEntityShapeResponse = await client.createEntityShape(createEntityShapeRequest);
  } catch (error) {
    console.log("createEntityShape Failed with error  " + error);
  }
})();