// 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: 919,
externalKey: "EXAMPLE-externalKey-Value",
shape: ({
modelType: "SHAPE",
type: ({
modelType: "COMPOSITE_TYPE",
elements: [
({
modelType: "PROXY_FIELD",
scope: "EXAMPLE-scope-Value",
scopeReference: ({
referenceObject: "EXAMPLE-referenceObject-Value",
referenceType:
dataintegration.models.ScopeReference.ReferenceType.OciFunctionInputShape,
refObjectName: "EXAMPLE-refObjectName-Value"
} as unknown) as dataintegration.models.ScopeReference,
labels: ["EXAMPLE--Value"],
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_pbU26: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 814,
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: 328,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ProxyField
],
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: 950,
configParameterDefinitions: {
EXAMPLE_KEY_q3SzA: ({
parameterName: "EXAMPLE-parameterName-Value",
description: "EXAMPLE-description-Value",
defaultValue: "EXAMPLE-defaultValue-Value",
classFieldName: "EXAMPLE-classFieldName-Value",
isStatic: true,
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: 279,
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.CompositeType,
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_DM55i: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 557,
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: 236,
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: 659,
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_fHe6n: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 797,
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: 191,
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_LDZ5Q: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 507,
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: 860,
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_9BXnJ: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 676,
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: 471,
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_f5bFZ: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 914,
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: 666,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
objectStatus: 842
} 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: 534,
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_MNItG: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 848,
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: 211,
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_PqtD7: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 332,
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,
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_UVrAX: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 428,
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: 637,
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_sDw76: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 944,
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: 618,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
updateRule: 348,
deleteRule: 759,
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: 89,
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_6VIjb: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 245,
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: 200,
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_Opl8b: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 169,
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: 103,
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_jtQxU: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 593,
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: 935,
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_1LxyW: ({
stringValue: "EXAMPLE-stringValue-Value",
intValue: 729,
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: 547,
name: "EXAMPLE-name-Value",
description: "EXAMPLE-description-Value"
} as unknown) as dataintegration.models.ShapeField
} as unknown) as dataintegration.models.KeyAttribute
],
objectStatus: 95
} as unknown) as dataintegration.models.PrimaryKey,
objectStatus: 804
} 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.None
} as unknown) as dataintegration.models.Compression
} as unknown) as dataintegration.models.DataFormat,
objectStatus: 146,
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: "P4XXANJNBKO7H3VBAY5V<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);
}
})();