// 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: "SQL_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: 310,
externalKey: "EXAMPLE-externalKey-Value",
shape: {
modelType: "SHAPE", type: {
modelType: "ARRAY_TYPE", elementType: "EXAMPLE-elementType-Value",
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: 463,
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_JGSVt :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 629,
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: 335,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
,
shapeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-shapeId-Value",
entityType: dataintegration.models.CreateEntityShapeFromSQL.EntityType.Table,
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: 628,
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_sg68X :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 644,
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: 795,
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_1dsPi :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 76,
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: 563,
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_4mOGG :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 936,
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: 380,
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_XZtjE :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 454,
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: 614,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
,
}
],
objectStatus: 382
}
],
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: 208,
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_adydm :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 946,
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: 630,
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_QSuyV :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 496,
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: 506,
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_lmtL1 :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 210,
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: 53,
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_Imyfa :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 616,
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: 971,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
,
}
],
updateRule: 422,
deleteRule: 414,
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",
}
,
name: "EXAMPLE-name-Value",
attributeRefs: [{
position: 354,
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_MzltZ :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 75,
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: 732,
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_Eahxj :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 541,
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: 173,
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_BhZZg :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 679,
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: 371,
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_GkMs4 :{
stringValue: "EXAMPLE-stringValue-Value",
intValue: 547,
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: 892,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
,
}
],
objectStatus: 45
}
,
objectStatus: 540
}
],
resourceName: "EXAMPLE-resourceName-Value",
dataFormat: {
formatAttribute: {
modelType: "JSON_FORMAT", encoding: "EXAMPLE-encoding-Value",
sampleEntityData: "EXAMPLE-sampleEntityData-Value",
isFilePattern: false
}
,
type: dataintegration.models.DataFormat.Type.Parquet,
compressionConfig: {
codec: dataintegration.models.Compression.Codec.Snappy,
}
,
}
,
objectStatus: 30,
identifier: "EXAMPLE-identifier-Value",
sqlQuery: "EXAMPLE-sqlQuery-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: "QAMGYYBUVMRVFZZYOZTQ<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);
}
})();