// 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"
} as unknown) as dataintegration.models.ParentReference,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value",
objectVersion: 318,
externalKey: "EXAMPLE-externalKey-Value",
shape: ({
modelType: "SHAPE",
type: ({
modelType: "CONFIGURED_TYPE",
wrappedType: "EXAMPLE-wrappedType-Value",
configValues: ({
configParamValues: {
EXAMPLE_KEY_EDX6c: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 102,
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,
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"
} as unknown) as dataintegration.models.ParentReference,
name: "EXAMPLE-name-Value",
isContained: true,
objectStatus: 101,
configParameterDefinitions: {
EXAMPLE_KEY_ICCsy: ({
parameterName: "EXAMPLE-parameterName-Value",
description: "EXAMPLE-description-Value",
defaultValue: "EXAMPLE-defaultValue-Value",
classFieldName: "EXAMPLE-classFieldName-Value",
isStatic: false,
isClassFieldValue: false
} as unknown) as dataintegration.models.ConfigParameterDefinition
}
} as unknown) as dataintegration.models.ConfigDefinition,
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: 678,
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ConfiguredType,
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_2xn5I: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 257,
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: 540,
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.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"
} as unknown) as dataintegration.models.ParentReference,
name: "EXAMPLE-name-Value",
attributeRefs: [
({
position: 295,
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_EhJm9: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 527,
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: 18,
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_ultOf: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 846,
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: 852,
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_9G9W4: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 972,
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: 443,
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_90exR: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 74,
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: 997,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
objectStatus: 546
} as unknown) as dataintegration.models.PrimaryKey
],
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: 515,
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_1Bchz: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 380,
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: 962,
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_nRQGl: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 894,
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: 967,
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_T6nSN: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 717,
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: 591,
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_CnQZb: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 632,
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: 266,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
updateRule: 780,
deleteRule: 82,
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"
} as unknown) as dataintegration.models.ParentReference,
name: "EXAMPLE-name-Value",
attributeRefs: [
({
position: 337,
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_SNF6n: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 196,
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: 796,
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_APJdG: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 529,
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: 382,
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_FLwyy: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 57,
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: 970,
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_nOUId: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 529,
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: 554,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
objectStatus: 16
} as unknown) as dataintegration.models.UniqueDataKey,
objectStatus: 523
} as unknown) as dataintegration.models.ForeignKey
],
resourceName: "EXAMPLE-resourceName-Value",
dataFormat: ({
formatAttribute: ({
modelType: "CSV_FORMAT",
encoding: "EXAMPLE-encoding-Value",
escapeCharacter: "EXAMPLE-escapeCharacter-Value",
delimiter: "EXAMPLE-delimiter-Value",
quoteCharacter: "EXAMPLE-quoteCharacter-Value",
hasHeader: true,
timestampFormat: "EXAMPLE-timestampFormat-Value",
isFilePattern: false
} as unknown) as dataintegration.models.CsvFormatAttribute,
type: dataintegration.models.DataFormat.Type.Csv,
compressionConfig: ({
codec: dataintegration.models.Compression.Codec.Deflate
} as unknown) as dataintegration.models.Compression
} as unknown) as dataintegration.models.DataFormat,
objectStatus: 604,
identifier: "EXAMPLE-identifier-Value",
sqlQuery: "EXAMPLE-sqlQuery-Value"
} as unknown) as dataintegration.models.CreateEntityShapeFromSQL;
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: "FJPA7HAYMHA8RSB8VJCH<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);
}
})();