UNPKG

@softchef/cdk-iot-device-management

Version:

IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.

206 lines (205 loc) 8.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DynamoDBDocument = void 0; const BatchExecuteStatementCommand_1 = require("./commands/BatchExecuteStatementCommand"); const BatchGetCommand_1 = require("./commands/BatchGetCommand"); const BatchWriteCommand_1 = require("./commands/BatchWriteCommand"); const DeleteCommand_1 = require("./commands/DeleteCommand"); const ExecuteStatementCommand_1 = require("./commands/ExecuteStatementCommand"); const ExecuteTransactionCommand_1 = require("./commands/ExecuteTransactionCommand"); const GetCommand_1 = require("./commands/GetCommand"); const PutCommand_1 = require("./commands/PutCommand"); const QueryCommand_1 = require("./commands/QueryCommand"); const ScanCommand_1 = require("./commands/ScanCommand"); const TransactGetCommand_1 = require("./commands/TransactGetCommand"); const TransactWriteCommand_1 = require("./commands/TransactWriteCommand"); const UpdateCommand_1 = require("./commands/UpdateCommand"); const DynamoDBDocumentClient_1 = require("./DynamoDBDocumentClient"); class DynamoDBDocument extends DynamoDBDocumentClient_1.DynamoDBDocumentClient { static from(client, translateConfig) { return new DynamoDBDocument(client, translateConfig); } batchExecuteStatement(args, optionsOrCb, cb) { const command = new BatchExecuteStatementCommand_1.BatchExecuteStatementCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } batchGet(args, optionsOrCb, cb) { const command = new BatchGetCommand_1.BatchGetCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } batchWrite(args, optionsOrCb, cb) { const command = new BatchWriteCommand_1.BatchWriteCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } delete(args, optionsOrCb, cb) { const command = new DeleteCommand_1.DeleteCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } executeStatement(args, optionsOrCb, cb) { const command = new ExecuteStatementCommand_1.ExecuteStatementCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } executeTransaction(args, optionsOrCb, cb) { const command = new ExecuteTransactionCommand_1.ExecuteTransactionCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } get(args, optionsOrCb, cb) { const command = new GetCommand_1.GetCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } put(args, optionsOrCb, cb) { const command = new PutCommand_1.PutCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } query(args, optionsOrCb, cb) { const command = new QueryCommand_1.QueryCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } scan(args, optionsOrCb, cb) { const command = new ScanCommand_1.ScanCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } transactGet(args, optionsOrCb, cb) { const command = new TransactGetCommand_1.TransactGetCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } transactWrite(args, optionsOrCb, cb) { const command = new TransactWriteCommand_1.TransactWriteCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } update(args, optionsOrCb, cb) { const command = new UpdateCommand_1.UpdateCommand(args); if (typeof optionsOrCb === "function") { this.send(command, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); this.send(command, optionsOrCb || {}, cb); } else { return this.send(command, optionsOrCb); } } } exports.DynamoDBDocument = DynamoDBDocument;