@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.
60 lines (59 loc) • 2.51 kB
JavaScript
import { __assign, __awaiter, __extends, __generator } from "tslib";
import { BatchWriteItemCommand as __BatchWriteItemCommand, } from "@aws-sdk/client-dynamodb";
import { Command as $Command } from "@aws-sdk/smithy-client";
import { marshallInput, unmarshallOutput } from "../commands/utils";
var BatchWriteCommand = (function (_super) {
__extends(BatchWriteCommand, _super);
function BatchWriteCommand(input) {
var _this = _super.call(this) || this;
_this.input = input;
_this.inputKeyNodes = [
{
key: "RequestItems",
children: {
children: [
{ key: "PutRequest", children: [{ key: "Item" }] },
{ key: "DeleteRequest", children: [{ key: "Key" }] },
],
},
},
];
_this.outputKeyNodes = [
{
key: "UnprocessedItems",
children: {
children: [
{ key: "PutRequest", children: [{ key: "Item" }] },
{ key: "DeleteRequest", children: [{ key: "Key" }] },
],
},
},
{
key: "ItemCollectionMetrics",
children: {
children: [{ key: "ItemCollectionKey" }],
},
},
];
return _this;
}
BatchWriteCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
var _this = this;
var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
var command = new __BatchWriteItemCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
var handler = command.resolveMiddleware(clientStack, configuration, options);
return function () { return __awaiter(_this, void 0, void 0, function () {
var data;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, handler(command)];
case 1:
data = _a.sent();
return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
}
});
}); };
};
return BatchWriteCommand;
}($Command));
export { BatchWriteCommand };