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.

37 lines (36 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScanCommand = void 0; const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); const smithy_client_1 = require("@aws-sdk/smithy-client"); const utils_1 = require("../commands/utils"); class ScanCommand extends smithy_client_1.Command { constructor(input) { super(); this.input = input; this.inputKeyNodes = [ { key: "ScanFilter", children: { children: [{ key: "AttributeValueList" }], }, }, { key: "ExclusiveStartKey" }, { key: "ExpressionAttributeValues" }, ]; this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }]; } resolveMiddleware(clientStack, configuration, options) { const { marshallOptions, unmarshallOptions } = configuration.translateConfig || {}; const command = new client_dynamodb_1.ScanCommand(utils_1.marshallInput(this.input, this.inputKeyNodes, marshallOptions)); const handler = command.resolveMiddleware(clientStack, configuration, options); return async () => { const data = await handler(command); return { ...data, output: utils_1.unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions), }; }; } } exports.ScanCommand = ScanCommand;