// 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: "FILE_ENTITY",
      key: "EXAMPLE-key-Value",
      modelVersion: "EXAMPLE-modelVersion-Value",
      parentRef: {
        parent: "EXAMPLE-parent-Value",
        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
      },
      name: "EXAMPLE-name-Value",
      description: "EXAMPLE-description-Value",
      objectVersion: 81,
      externalKey: "EXAMPLE-externalKey-Value",
      shape: {
        modelType: "SHAPE",
        type: {
          modelType: "JAVA_TYPE",
          javaTypeName: "EXAMPLE-javaTypeName-Value",
          configDefinition: {
            key: "EXAMPLE-key-Value",
            modelType: "EXAMPLE-modelType-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            },
            name: "EXAMPLE-name-Value",
            isContained: false,
            objectStatus: 675,
            configParameterDefinitions: {
              EXAMPLE_KEY_YT397: {
                parameterName: "EXAMPLE-parameterName-Value",
                description: "EXAMPLE-description-Value",
                defaultValue: "EXAMPLE-defaultValue-Value",
                classFieldName: "EXAMPLE-classFieldName-Value",
                isStatic: false,
                isClassFieldValue: true
              }
            }
          },
          key: "EXAMPLE-key-Value",
          modelVersion: "EXAMPLE-modelVersion-Value",
          parentRef: {
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          },
          name: "EXAMPLE-name-Value",
          objectStatus: 89,
          description: "EXAMPLE-description-Value"
        },
        key: "EXAMPLE-key-Value",
        modelVersion: "EXAMPLE-modelVersion-Value",
        parentRef: {
          parent: "EXAMPLE-parent-Value",
          rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
        },
        configValues: {
          configParamValues: {
            EXAMPLE_KEY_ItUf7: {
              stringValue: "EXAMPLE-stringValue-Value",
              intValue: 783,
              objectValue: "EXAMPLE-objectValue-Value",
              refValue: "EXAMPLE-refValue-Value",
              parameterValue: "EXAMPLE-parameterValue-Value",
              rootObjectValue: "EXAMPLE-rootObjectValue-Value"
            }
          },
          parentRef: {
            parent: "EXAMPLE-parent-Value",
            rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
          }
        },
        objectStatus: 265,
        name: "EXAMPLE-name-Value",
        description: "EXAMPLE-description-Value"
      },
      shapeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value",
      types: {
        key: "EXAMPLE-key-Value",
        modelType: "EXAMPLE-modelType-Value",
        modelVersion: "EXAMPLE-modelVersion-Value",
        parentRef: {
          parent: "EXAMPLE-parent-Value",
          rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
        },
        name: "EXAMPLE-name-Value",
        description: "EXAMPLE-description-Value",
        objectVersion: 773,
        types: {
          EXAMPLE_KEY_ERc1m: {
            modelType: "DERIVED_TYPE",
            key: "EXAMPLE-key-Value",
            modelVersion: "EXAMPLE-modelVersion-Value",
            parentRef: {
              parent: "EXAMPLE-parent-Value",
              rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
            },
            name: "EXAMPLE-name-Value",
            objectStatus: 339,
            description: "EXAMPLE-description-Value"
          }
        },
        objectStatus: 72,
        identifier: "EXAMPLE-identifier-Value"
      },
      entityType: dataintegration.models.CreateEntityShapeFromFile.EntityType.View,
      otherTypeLabel: "EXAMPLE-otherTypeLabel-Value",
      uniqueKeys: [
        {
          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"
          },
          name: "EXAMPLE-name-Value",
          attributeRefs: [
            {
              position: 998,
              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_w36Fb: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 253,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  position: 980,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: true
                },
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_VtK1X: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 521,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 17,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              },
              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_BVtMP: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 241,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  position: 764,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: false
                },
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_CI8aG: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 917,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 354,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            }
          ],
          objectStatus: 81
        }
      ],
      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"
          },
          name: "EXAMPLE-name-Value",
          attributeRefs: [
            {
              position: 914,
              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_3caMH: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 835,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  position: 748,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: false
                },
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_uRBhL: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 618,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 339,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              },
              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_hfPn5: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 334,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  position: 954,
                  defaultValueString: "EXAMPLE-defaultValueString-Value",
                  isMandatory: true
                },
                key: "EXAMPLE-key-Value",
                modelVersion: "EXAMPLE-modelVersion-Value",
                parentRef: {
                  parent: "EXAMPLE-parent-Value",
                  rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                },
                configValues: {
                  configParamValues: {
                    EXAMPLE_KEY_WGGoy: {
                      stringValue: "EXAMPLE-stringValue-Value",
                      intValue: 266,
                      objectValue: "EXAMPLE-objectValue-Value",
                      refValue: "EXAMPLE-refValue-Value",
                      parameterValue: "EXAMPLE-parameterValue-Value",
                      rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                    }
                  },
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  }
                },
                objectStatus: 85,
                name: "EXAMPLE-name-Value",
                description: "EXAMPLE-description-Value"
              }
            }
          ],
          updateRule: 725,
          deleteRule: 6,
          referenceUniqueKey: {
            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"
            },
            name: "EXAMPLE-name-Value",
            attributeRefs: [
              {
                position: 230,
                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_bfiFj: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 730,
                          objectValue: "EXAMPLE-objectValue-Value",
                          refValue: "EXAMPLE-refValue-Value",
                          parameterValue: "EXAMPLE-parameterValue-Value",
                          rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                        }
                      },
                      parentRef: {
                        parent: "EXAMPLE-parent-Value",
                        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                      }
                    },
                    position: 500,
                    defaultValueString: "EXAMPLE-defaultValueString-Value",
                    isMandatory: false
                  },
                  key: "EXAMPLE-key-Value",
                  modelVersion: "EXAMPLE-modelVersion-Value",
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  },
                  configValues: {
                    configParamValues: {
                      EXAMPLE_KEY_dmom3: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 275,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  objectStatus: 702,
                  name: "EXAMPLE-name-Value",
                  description: "EXAMPLE-description-Value"
                },
                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_fc06y: {
                          stringValue: "EXAMPLE-stringValue-Value",
                          intValue: 70,
                          objectValue: "EXAMPLE-objectValue-Value",
                          refValue: "EXAMPLE-refValue-Value",
                          parameterValue: "EXAMPLE-parameterValue-Value",
                          rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                        }
                      },
                      parentRef: {
                        parent: "EXAMPLE-parent-Value",
                        rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                      }
                    },
                    position: 263,
                    defaultValueString: "EXAMPLE-defaultValueString-Value",
                    isMandatory: false
                  },
                  key: "EXAMPLE-key-Value",
                  modelVersion: "EXAMPLE-modelVersion-Value",
                  parentRef: {
                    parent: "EXAMPLE-parent-Value",
                    rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                  },
                  configValues: {
                    configParamValues: {
                      EXAMPLE_KEY_AcdLh: {
                        stringValue: "EXAMPLE-stringValue-Value",
                        intValue: 339,
                        objectValue: "EXAMPLE-objectValue-Value",
                        refValue: "EXAMPLE-refValue-Value",
                        parameterValue: "EXAMPLE-parameterValue-Value",
                        rootObjectValue: "EXAMPLE-rootObjectValue-Value"
                      }
                    },
                    parentRef: {
                      parent: "EXAMPLE-parent-Value",
                      rootDocId: "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
                    }
                  },
                  objectStatus: 509,
                  name: "EXAMPLE-name-Value",
                  description: "EXAMPLE-description-Value"
                }
              }
            ],
            objectStatus: 888
          },
          objectStatus: 656
        }
      ],
      resourceName: "EXAMPLE-resourceName-Value",
      dataFormat: {
        formatAttribute: {
          modelType: "PARQUET_FORMAT",
          compression: "EXAMPLE-compression-Value",
          isFilePattern: false
        },
        type: dataintegration.models.DataFormat.Type.Avro,
        compressionConfig: {
          codec: dataintegration.models.Compression.Codec.Snappy
        }
      },
      objectStatus: 808,
      identifier: "EXAMPLE-identifier-Value"
    };

    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: "RZOYLL8EQ6XH6XRHBRHY<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);
  }
})();