// 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: 446,
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: 205,
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_6C8r1: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 481,
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: 907,
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: 862,
types: {
EXAMPLE_KEY_hJsog: {
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: 256,
description: "EXAMPLE-description-Value"
}
},
objectStatus: 554,
identifier: "EXAMPLE-identifier-Value"
},
entityType: dataintegration.models.CreateEntityShapeFromFile.EntityType.Other,
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"
},
name: "EXAMPLE-name-Value",
attributeRefs: [
{
position: 883,
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_5SpL3: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 830,
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: 125,
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_yqSz6: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 683,
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: 497,
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_fK3aQ: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 974,
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: 563,
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_uqOLV: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 62,
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: 128,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
}
],
objectStatus: 690
}
],
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: 5,
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_VqHqo: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 916,
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: 667,
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_C7Z5k: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 149,
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: 314,
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_5MVcX: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 301,
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: 228,
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_zbXHv: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 941,
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: 111,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
}
],
updateRule: 489,
deleteRule: 337,
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: 418,
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_jp6Jc: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 64,
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: 540,
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_nvdQn: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 760,
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: 569,
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_oicTV: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 691,
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: 721,
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_J7EpI: {
stringValue: "EXAMPLE-stringValue-Value",
intValue: 532,
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: 415,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
}
}
],
objectStatus: 554
},
objectStatus: 209
}
],
resourceName: "EXAMPLE-resourceName-Value",
dataFormat: {
formatAttribute: {
modelType: "AVRO_FORMAT",
compression: "EXAMPLE-compression-Value",
isFilePattern: true
},
type: dataintegration.models.DataFormat.Type.Json,
compressionConfig: {
codec: dataintegration.models.Compression.Codec.Gzip
}
},
objectStatus: 738,
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: "KBQLMQ42V0OF3T4JI9OW<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);
}
})();