-
Notifications
You must be signed in to change notification settings - Fork 611
/
Copy pathExecuteStatementCommand.ts
92 lines (82 loc) · 3.22 KB
/
ExecuteStatementCommand.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// smithy-typescript generated code
import { ExecuteStatementCommand as __ExecuteStatementCommand } from "@aws-sdk/client-dynamodb";
import { Command as $Command } from "@smithy/smithy-client";
import type { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@smithy/types";
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
import type {
DynamoDBDocumentClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../DynamoDBDocumentClient";
/**
* @public
*/
export { DynamoDBDocumentClientCommand, $Command };
/**
* @public
*/
export type ExecuteStatementCommandInput = Omit<__ExecuteStatementCommandInput, "Parameters"> & {
Parameters?: NativeAttributeValue[];
};
/**
* @public
*/
export type ExecuteStatementCommandOutput = Omit<__ExecuteStatementCommandOutput, "Items" | "LastEvaluatedKey"> & {
Items?: Record<string, NativeAttributeValue>[];
LastEvaluatedKey?: Record<string, NativeAttributeValue>;
};
/**
* Accepts native JavaScript types instead of `AttributeValue`s, and calls
* ExecuteStatementCommand operation from {@link @aws-sdk/client-dynamodb#ExecuteStatementCommand}.
*
* JavaScript objects passed in as parameters are marshalled into `AttributeValue` shapes
* required by Amazon DynamoDB. Responses from DynamoDB are unmarshalled into plain JavaScript objects.
*
* @public
*/
export class ExecuteStatementCommand extends DynamoDBDocumentClientCommand<
ExecuteStatementCommandInput,
ExecuteStatementCommandOutput,
__ExecuteStatementCommandInput,
__ExecuteStatementCommandOutput,
DynamoDBDocumentClientResolvedConfig
> {
protected readonly inputKeyNodes = {
Parameters: ALL_MEMBERS, // set/list of AttributeValue
};
protected readonly outputKeyNodes = {
Items: {
"*": ALL_VALUES, // map with AttributeValue
},
LastEvaluatedKey: ALL_VALUES, // map with AttributeValue
};
protected readonly clientCommand: __ExecuteStatementCommand;
public readonly middlewareStack: MiddlewareStack<
ExecuteStatementCommandInput | __ExecuteStatementCommandInput,
ExecuteStatementCommandOutput | __ExecuteStatementCommandOutput
>;
constructor(readonly input: ExecuteStatementCommandInput) {
super();
this.clientCommand = new __ExecuteStatementCommand(this.input as any);
this.middlewareStack = this.clientCommand.middlewareStack;
}
/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: DynamoDBDocumentClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ExecuteStatementCommandInput, ExecuteStatementCommandOutput> {
this.addMarshallingMiddleware(configuration);
const stack = clientStack.concat(this.middlewareStack as typeof clientStack);
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
return async () => handler(this.clientCommand);
}
}
import type {
ExecuteStatementCommandInput as __ExecuteStatementCommandInput,
ExecuteStatementCommandOutput as __ExecuteStatementCommandOutput,
} from "@aws-sdk/client-dynamodb";
import type { NativeAttributeValue } from "@aws-sdk/util-dynamodb";