@aws-sdk/client-dynamodb-streams 3.181.0 → 3.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist-es/DynamoDBStreams.js +18 -25
- package/dist-es/DynamoDBStreamsClient.js +22 -28
- package/dist-es/commands/DescribeStreamCommand.js +21 -28
- package/dist-es/commands/GetRecordsCommand.js +21 -28
- package/dist-es/commands/GetShardIteratorCommand.js +21 -28
- package/dist-es/commands/ListStreamsCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/DynamoDBStreamsServiceException.js +5 -10
- package/dist-es/models/models_0.js +131 -100
- package/dist-es/protocols/Aws_json1_0.js +359 -453
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,356 +1,284 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { DynamoDBStreamsServiceException as __BaseException } from "../models/DynamoDBStreamsServiceException";
|
|
5
4
|
import { ExpiredIteratorException, InternalServerError, LimitExceededException, ResourceNotFoundException, TrimmedDataAccessException, } from "../models/models_0";
|
|
6
|
-
export
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
case "InternalServerError": return [3, 2];
|
|
205
|
-
case "com.amazonaws.dynamodbstreams#InternalServerError": return [3, 2];
|
|
206
|
-
case "ResourceNotFoundException": return [3, 4];
|
|
207
|
-
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": return [3, 4];
|
|
208
|
-
case "TrimmedDataAccessException": return [3, 6];
|
|
209
|
-
case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException": return [3, 6];
|
|
210
|
-
}
|
|
211
|
-
return [3, 8];
|
|
212
|
-
case 2: return [4, deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context)];
|
|
213
|
-
case 3: throw _d.sent();
|
|
214
|
-
case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
215
|
-
case 5: throw _d.sent();
|
|
216
|
-
case 6: return [4, deserializeAws_json1_0TrimmedDataAccessExceptionResponse(parsedOutput, context)];
|
|
217
|
-
case 7: throw _d.sent();
|
|
218
|
-
case 8:
|
|
219
|
-
parsedBody = parsedOutput.body;
|
|
220
|
-
throwDefaultError({
|
|
221
|
-
output: output,
|
|
222
|
-
parsedBody: parsedBody,
|
|
223
|
-
exceptionCtor: __BaseException,
|
|
224
|
-
errorCode: errorCode,
|
|
225
|
-
});
|
|
226
|
-
_d.label = 9;
|
|
227
|
-
case 9: return [2];
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}); };
|
|
231
|
-
export var deserializeAws_json1_0ListStreamsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
232
|
-
var data, contents, response;
|
|
233
|
-
return __generator(this, function (_a) {
|
|
234
|
-
switch (_a.label) {
|
|
235
|
-
case 0:
|
|
236
|
-
if (output.statusCode >= 300) {
|
|
237
|
-
return [2, deserializeAws_json1_0ListStreamsCommandError(output, context)];
|
|
238
|
-
}
|
|
239
|
-
return [4, parseBody(output.body, context)];
|
|
240
|
-
case 1:
|
|
241
|
-
data = _a.sent();
|
|
242
|
-
contents = {};
|
|
243
|
-
contents = deserializeAws_json1_0ListStreamsOutput(data, context);
|
|
244
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
245
|
-
return [2, Promise.resolve(response)];
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}); };
|
|
249
|
-
var deserializeAws_json1_0ListStreamsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
250
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
251
|
-
var _c;
|
|
252
|
-
return __generator(this, function (_d) {
|
|
253
|
-
switch (_d.label) {
|
|
254
|
-
case 0:
|
|
255
|
-
_a = [__assign({}, output)];
|
|
256
|
-
_c = {};
|
|
257
|
-
return [4, parseErrorBody(output.body, context)];
|
|
258
|
-
case 1:
|
|
259
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
260
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
261
|
-
_b = errorCode;
|
|
262
|
-
switch (_b) {
|
|
263
|
-
case "InternalServerError": return [3, 2];
|
|
264
|
-
case "com.amazonaws.dynamodbstreams#InternalServerError": return [3, 2];
|
|
265
|
-
case "ResourceNotFoundException": return [3, 4];
|
|
266
|
-
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": return [3, 4];
|
|
267
|
-
}
|
|
268
|
-
return [3, 6];
|
|
269
|
-
case 2: return [4, deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context)];
|
|
270
|
-
case 3: throw _d.sent();
|
|
271
|
-
case 4: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
272
|
-
case 5: throw _d.sent();
|
|
273
|
-
case 6:
|
|
274
|
-
parsedBody = parsedOutput.body;
|
|
275
|
-
throwDefaultError({
|
|
276
|
-
output: output,
|
|
277
|
-
parsedBody: parsedBody,
|
|
278
|
-
exceptionCtor: __BaseException,
|
|
279
|
-
errorCode: errorCode,
|
|
280
|
-
});
|
|
281
|
-
_d.label = 7;
|
|
282
|
-
case 7: return [2];
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}); };
|
|
286
|
-
var deserializeAws_json1_0ExpiredIteratorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
287
|
-
var body, deserialized, exception;
|
|
288
|
-
return __generator(this, function (_a) {
|
|
289
|
-
body = parsedOutput.body;
|
|
290
|
-
deserialized = deserializeAws_json1_0ExpiredIteratorException(body, context);
|
|
291
|
-
exception = new ExpiredIteratorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
292
|
-
return [2, __decorateServiceException(exception, body)];
|
|
5
|
+
export const serializeAws_json1_0DescribeStreamCommand = async (input, context) => {
|
|
6
|
+
const headers = {
|
|
7
|
+
"content-type": "application/x-amz-json-1.0",
|
|
8
|
+
"x-amz-target": "DynamoDBStreams_20120810.DescribeStream",
|
|
9
|
+
};
|
|
10
|
+
let body;
|
|
11
|
+
body = JSON.stringify(serializeAws_json1_0DescribeStreamInput(input, context));
|
|
12
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
|
+
};
|
|
14
|
+
export const serializeAws_json1_0GetRecordsCommand = async (input, context) => {
|
|
15
|
+
const headers = {
|
|
16
|
+
"content-type": "application/x-amz-json-1.0",
|
|
17
|
+
"x-amz-target": "DynamoDBStreams_20120810.GetRecords",
|
|
18
|
+
};
|
|
19
|
+
let body;
|
|
20
|
+
body = JSON.stringify(serializeAws_json1_0GetRecordsInput(input, context));
|
|
21
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
|
+
};
|
|
23
|
+
export const serializeAws_json1_0GetShardIteratorCommand = async (input, context) => {
|
|
24
|
+
const headers = {
|
|
25
|
+
"content-type": "application/x-amz-json-1.0",
|
|
26
|
+
"x-amz-target": "DynamoDBStreams_20120810.GetShardIterator",
|
|
27
|
+
};
|
|
28
|
+
let body;
|
|
29
|
+
body = JSON.stringify(serializeAws_json1_0GetShardIteratorInput(input, context));
|
|
30
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
31
|
+
};
|
|
32
|
+
export const serializeAws_json1_0ListStreamsCommand = async (input, context) => {
|
|
33
|
+
const headers = {
|
|
34
|
+
"content-type": "application/x-amz-json-1.0",
|
|
35
|
+
"x-amz-target": "DynamoDBStreams_20120810.ListStreams",
|
|
36
|
+
};
|
|
37
|
+
let body;
|
|
38
|
+
body = JSON.stringify(serializeAws_json1_0ListStreamsInput(input, context));
|
|
39
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
40
|
+
};
|
|
41
|
+
export const deserializeAws_json1_0DescribeStreamCommand = async (output, context) => {
|
|
42
|
+
if (output.statusCode >= 300) {
|
|
43
|
+
return deserializeAws_json1_0DescribeStreamCommandError(output, context);
|
|
44
|
+
}
|
|
45
|
+
const data = await parseBody(output.body, context);
|
|
46
|
+
let contents = {};
|
|
47
|
+
contents = deserializeAws_json1_0DescribeStreamOutput(data, context);
|
|
48
|
+
const response = {
|
|
49
|
+
$metadata: deserializeMetadata(output),
|
|
50
|
+
...contents,
|
|
51
|
+
};
|
|
52
|
+
return Promise.resolve(response);
|
|
53
|
+
};
|
|
54
|
+
const deserializeAws_json1_0DescribeStreamCommandError = async (output, context) => {
|
|
55
|
+
const parsedOutput = {
|
|
56
|
+
...output,
|
|
57
|
+
body: await parseErrorBody(output.body, context),
|
|
58
|
+
};
|
|
59
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
60
|
+
switch (errorCode) {
|
|
61
|
+
case "InternalServerError":
|
|
62
|
+
case "com.amazonaws.dynamodbstreams#InternalServerError":
|
|
63
|
+
throw await deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context);
|
|
64
|
+
case "ResourceNotFoundException":
|
|
65
|
+
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
|
|
66
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
67
|
+
default:
|
|
68
|
+
const parsedBody = parsedOutput.body;
|
|
69
|
+
throwDefaultError({
|
|
70
|
+
output,
|
|
71
|
+
parsedBody,
|
|
72
|
+
exceptionCtor: __BaseException,
|
|
73
|
+
errorCode,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export const deserializeAws_json1_0GetRecordsCommand = async (output, context) => {
|
|
78
|
+
if (output.statusCode >= 300) {
|
|
79
|
+
return deserializeAws_json1_0GetRecordsCommandError(output, context);
|
|
80
|
+
}
|
|
81
|
+
const data = await parseBody(output.body, context);
|
|
82
|
+
let contents = {};
|
|
83
|
+
contents = deserializeAws_json1_0GetRecordsOutput(data, context);
|
|
84
|
+
const response = {
|
|
85
|
+
$metadata: deserializeMetadata(output),
|
|
86
|
+
...contents,
|
|
87
|
+
};
|
|
88
|
+
return Promise.resolve(response);
|
|
89
|
+
};
|
|
90
|
+
const deserializeAws_json1_0GetRecordsCommandError = async (output, context) => {
|
|
91
|
+
const parsedOutput = {
|
|
92
|
+
...output,
|
|
93
|
+
body: await parseErrorBody(output.body, context),
|
|
94
|
+
};
|
|
95
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
96
|
+
switch (errorCode) {
|
|
97
|
+
case "ExpiredIteratorException":
|
|
98
|
+
case "com.amazonaws.dynamodbstreams#ExpiredIteratorException":
|
|
99
|
+
throw await deserializeAws_json1_0ExpiredIteratorExceptionResponse(parsedOutput, context);
|
|
100
|
+
case "InternalServerError":
|
|
101
|
+
case "com.amazonaws.dynamodbstreams#InternalServerError":
|
|
102
|
+
throw await deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context);
|
|
103
|
+
case "LimitExceededException":
|
|
104
|
+
case "com.amazonaws.dynamodbstreams#LimitExceededException":
|
|
105
|
+
throw await deserializeAws_json1_0LimitExceededExceptionResponse(parsedOutput, context);
|
|
106
|
+
case "ResourceNotFoundException":
|
|
107
|
+
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
|
|
108
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
109
|
+
case "TrimmedDataAccessException":
|
|
110
|
+
case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
|
|
111
|
+
throw await deserializeAws_json1_0TrimmedDataAccessExceptionResponse(parsedOutput, context);
|
|
112
|
+
default:
|
|
113
|
+
const parsedBody = parsedOutput.body;
|
|
114
|
+
throwDefaultError({
|
|
115
|
+
output,
|
|
116
|
+
parsedBody,
|
|
117
|
+
exceptionCtor: __BaseException,
|
|
118
|
+
errorCode,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
export const deserializeAws_json1_0GetShardIteratorCommand = async (output, context) => {
|
|
123
|
+
if (output.statusCode >= 300) {
|
|
124
|
+
return deserializeAws_json1_0GetShardIteratorCommandError(output, context);
|
|
125
|
+
}
|
|
126
|
+
const data = await parseBody(output.body, context);
|
|
127
|
+
let contents = {};
|
|
128
|
+
contents = deserializeAws_json1_0GetShardIteratorOutput(data, context);
|
|
129
|
+
const response = {
|
|
130
|
+
$metadata: deserializeMetadata(output),
|
|
131
|
+
...contents,
|
|
132
|
+
};
|
|
133
|
+
return Promise.resolve(response);
|
|
134
|
+
};
|
|
135
|
+
const deserializeAws_json1_0GetShardIteratorCommandError = async (output, context) => {
|
|
136
|
+
const parsedOutput = {
|
|
137
|
+
...output,
|
|
138
|
+
body: await parseErrorBody(output.body, context),
|
|
139
|
+
};
|
|
140
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
141
|
+
switch (errorCode) {
|
|
142
|
+
case "InternalServerError":
|
|
143
|
+
case "com.amazonaws.dynamodbstreams#InternalServerError":
|
|
144
|
+
throw await deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context);
|
|
145
|
+
case "ResourceNotFoundException":
|
|
146
|
+
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
|
|
147
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
148
|
+
case "TrimmedDataAccessException":
|
|
149
|
+
case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
|
|
150
|
+
throw await deserializeAws_json1_0TrimmedDataAccessExceptionResponse(parsedOutput, context);
|
|
151
|
+
default:
|
|
152
|
+
const parsedBody = parsedOutput.body;
|
|
153
|
+
throwDefaultError({
|
|
154
|
+
output,
|
|
155
|
+
parsedBody,
|
|
156
|
+
exceptionCtor: __BaseException,
|
|
157
|
+
errorCode,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
export const deserializeAws_json1_0ListStreamsCommand = async (output, context) => {
|
|
162
|
+
if (output.statusCode >= 300) {
|
|
163
|
+
return deserializeAws_json1_0ListStreamsCommandError(output, context);
|
|
164
|
+
}
|
|
165
|
+
const data = await parseBody(output.body, context);
|
|
166
|
+
let contents = {};
|
|
167
|
+
contents = deserializeAws_json1_0ListStreamsOutput(data, context);
|
|
168
|
+
const response = {
|
|
169
|
+
$metadata: deserializeMetadata(output),
|
|
170
|
+
...contents,
|
|
171
|
+
};
|
|
172
|
+
return Promise.resolve(response);
|
|
173
|
+
};
|
|
174
|
+
const deserializeAws_json1_0ListStreamsCommandError = async (output, context) => {
|
|
175
|
+
const parsedOutput = {
|
|
176
|
+
...output,
|
|
177
|
+
body: await parseErrorBody(output.body, context),
|
|
178
|
+
};
|
|
179
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
180
|
+
switch (errorCode) {
|
|
181
|
+
case "InternalServerError":
|
|
182
|
+
case "com.amazonaws.dynamodbstreams#InternalServerError":
|
|
183
|
+
throw await deserializeAws_json1_0InternalServerErrorResponse(parsedOutput, context);
|
|
184
|
+
case "ResourceNotFoundException":
|
|
185
|
+
case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
|
|
186
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
187
|
+
default:
|
|
188
|
+
const parsedBody = parsedOutput.body;
|
|
189
|
+
throwDefaultError({
|
|
190
|
+
output,
|
|
191
|
+
parsedBody,
|
|
192
|
+
exceptionCtor: __BaseException,
|
|
193
|
+
errorCode,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
const deserializeAws_json1_0ExpiredIteratorExceptionResponse = async (parsedOutput, context) => {
|
|
198
|
+
const body = parsedOutput.body;
|
|
199
|
+
const deserialized = deserializeAws_json1_0ExpiredIteratorException(body, context);
|
|
200
|
+
const exception = new ExpiredIteratorException({
|
|
201
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
202
|
+
...deserialized,
|
|
293
203
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
204
|
+
return __decorateServiceException(exception, body);
|
|
205
|
+
};
|
|
206
|
+
const deserializeAws_json1_0InternalServerErrorResponse = async (parsedOutput, context) => {
|
|
207
|
+
const body = parsedOutput.body;
|
|
208
|
+
const deserialized = deserializeAws_json1_0InternalServerError(body, context);
|
|
209
|
+
const exception = new InternalServerError({
|
|
210
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
211
|
+
...deserialized,
|
|
302
212
|
});
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
213
|
+
return __decorateServiceException(exception, body);
|
|
214
|
+
};
|
|
215
|
+
const deserializeAws_json1_0LimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
216
|
+
const body = parsedOutput.body;
|
|
217
|
+
const deserialized = deserializeAws_json1_0LimitExceededException(body, context);
|
|
218
|
+
const exception = new LimitExceededException({
|
|
219
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
220
|
+
...deserialized,
|
|
311
221
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
222
|
+
return __decorateServiceException(exception, body);
|
|
223
|
+
};
|
|
224
|
+
const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
225
|
+
const body = parsedOutput.body;
|
|
226
|
+
const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
|
|
227
|
+
const exception = new ResourceNotFoundException({
|
|
228
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
229
|
+
...deserialized,
|
|
320
230
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
231
|
+
return __decorateServiceException(exception, body);
|
|
232
|
+
};
|
|
233
|
+
const deserializeAws_json1_0TrimmedDataAccessExceptionResponse = async (parsedOutput, context) => {
|
|
234
|
+
const body = parsedOutput.body;
|
|
235
|
+
const deserialized = deserializeAws_json1_0TrimmedDataAccessException(body, context);
|
|
236
|
+
const exception = new TrimmedDataAccessException({
|
|
237
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
238
|
+
...deserialized,
|
|
329
239
|
});
|
|
330
|
-
|
|
331
|
-
var serializeAws_json1_0DescribeStreamInput = function (input, context) {
|
|
332
|
-
return __assign(__assign(__assign({}, (input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId })), (input.Limit != null && { Limit: input.Limit })), (input.StreamArn != null && { StreamArn: input.StreamArn }));
|
|
240
|
+
return __decorateServiceException(exception, body);
|
|
333
241
|
};
|
|
334
|
-
|
|
335
|
-
return
|
|
242
|
+
const serializeAws_json1_0DescribeStreamInput = (input, context) => {
|
|
243
|
+
return {
|
|
244
|
+
...(input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId }),
|
|
245
|
+
...(input.Limit != null && { Limit: input.Limit }),
|
|
246
|
+
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
247
|
+
};
|
|
336
248
|
};
|
|
337
|
-
|
|
338
|
-
return
|
|
249
|
+
const serializeAws_json1_0GetRecordsInput = (input, context) => {
|
|
250
|
+
return {
|
|
251
|
+
...(input.Limit != null && { Limit: input.Limit }),
|
|
252
|
+
...(input.ShardIterator != null && { ShardIterator: input.ShardIterator }),
|
|
253
|
+
};
|
|
339
254
|
};
|
|
340
|
-
|
|
341
|
-
return
|
|
255
|
+
const serializeAws_json1_0GetShardIteratorInput = (input, context) => {
|
|
256
|
+
return {
|
|
257
|
+
...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
|
|
258
|
+
...(input.ShardId != null && { ShardId: input.ShardId }),
|
|
259
|
+
...(input.ShardIteratorType != null && { ShardIteratorType: input.ShardIteratorType }),
|
|
260
|
+
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
261
|
+
};
|
|
342
262
|
};
|
|
343
|
-
|
|
344
|
-
return
|
|
345
|
-
|
|
346
|
-
|
|
263
|
+
const serializeAws_json1_0ListStreamsInput = (input, context) => {
|
|
264
|
+
return {
|
|
265
|
+
...(input.ExclusiveStartStreamArn != null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }),
|
|
266
|
+
...(input.Limit != null && { Limit: input.Limit }),
|
|
267
|
+
...(input.TableName != null && { TableName: input.TableName }),
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
const deserializeAws_json1_0AttributeMap = (output, context) => {
|
|
271
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
347
272
|
if (value === null) {
|
|
348
273
|
return acc;
|
|
349
274
|
}
|
|
350
|
-
return
|
|
275
|
+
return {
|
|
276
|
+
...acc,
|
|
277
|
+
[key]: deserializeAws_json1_0AttributeValue(__expectUnion(value), context),
|
|
278
|
+
};
|
|
351
279
|
}, {});
|
|
352
280
|
};
|
|
353
|
-
|
|
281
|
+
const deserializeAws_json1_0AttributeValue = (output, context) => {
|
|
354
282
|
if (output.B != null) {
|
|
355
283
|
return {
|
|
356
284
|
B: context.base64Decoder(output.B),
|
|
@@ -395,10 +323,10 @@ var deserializeAws_json1_0AttributeValue = function (output, context) {
|
|
|
395
323
|
}
|
|
396
324
|
return { $unknown: Object.entries(output)[0] };
|
|
397
325
|
};
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
.filter(
|
|
401
|
-
.map(
|
|
326
|
+
const deserializeAws_json1_0BinarySetAttributeValue = (output, context) => {
|
|
327
|
+
const retVal = (output || [])
|
|
328
|
+
.filter((e) => e != null)
|
|
329
|
+
.map((entry) => {
|
|
402
330
|
if (entry === null) {
|
|
403
331
|
return null;
|
|
404
332
|
}
|
|
@@ -406,44 +334,44 @@ var deserializeAws_json1_0BinarySetAttributeValue = function (output, context) {
|
|
|
406
334
|
});
|
|
407
335
|
return retVal;
|
|
408
336
|
};
|
|
409
|
-
|
|
337
|
+
const deserializeAws_json1_0DescribeStreamOutput = (output, context) => {
|
|
410
338
|
return {
|
|
411
339
|
StreamDescription: output.StreamDescription != null
|
|
412
340
|
? deserializeAws_json1_0StreamDescription(output.StreamDescription, context)
|
|
413
341
|
: undefined,
|
|
414
342
|
};
|
|
415
343
|
};
|
|
416
|
-
|
|
344
|
+
const deserializeAws_json1_0ExpiredIteratorException = (output, context) => {
|
|
417
345
|
return {
|
|
418
346
|
message: __expectString(output.message),
|
|
419
347
|
};
|
|
420
348
|
};
|
|
421
|
-
|
|
349
|
+
const deserializeAws_json1_0GetRecordsOutput = (output, context) => {
|
|
422
350
|
return {
|
|
423
351
|
NextShardIterator: __expectString(output.NextShardIterator),
|
|
424
352
|
Records: output.Records != null ? deserializeAws_json1_0RecordList(output.Records, context) : undefined,
|
|
425
353
|
};
|
|
426
354
|
};
|
|
427
|
-
|
|
355
|
+
const deserializeAws_json1_0GetShardIteratorOutput = (output, context) => {
|
|
428
356
|
return {
|
|
429
357
|
ShardIterator: __expectString(output.ShardIterator),
|
|
430
358
|
};
|
|
431
359
|
};
|
|
432
|
-
|
|
360
|
+
const deserializeAws_json1_0Identity = (output, context) => {
|
|
433
361
|
return {
|
|
434
362
|
PrincipalId: __expectString(output.PrincipalId),
|
|
435
363
|
Type: __expectString(output.Type),
|
|
436
364
|
};
|
|
437
365
|
};
|
|
438
|
-
|
|
366
|
+
const deserializeAws_json1_0InternalServerError = (output, context) => {
|
|
439
367
|
return {
|
|
440
368
|
message: __expectString(output.message),
|
|
441
369
|
};
|
|
442
370
|
};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
.filter(
|
|
446
|
-
.map(
|
|
371
|
+
const deserializeAws_json1_0KeySchema = (output, context) => {
|
|
372
|
+
const retVal = (output || [])
|
|
373
|
+
.filter((e) => e != null)
|
|
374
|
+
.map((entry) => {
|
|
447
375
|
if (entry === null) {
|
|
448
376
|
return null;
|
|
449
377
|
}
|
|
@@ -451,21 +379,21 @@ var deserializeAws_json1_0KeySchema = function (output, context) {
|
|
|
451
379
|
});
|
|
452
380
|
return retVal;
|
|
453
381
|
};
|
|
454
|
-
|
|
382
|
+
const deserializeAws_json1_0KeySchemaElement = (output, context) => {
|
|
455
383
|
return {
|
|
456
384
|
AttributeName: __expectString(output.AttributeName),
|
|
457
385
|
KeyType: __expectString(output.KeyType),
|
|
458
386
|
};
|
|
459
387
|
};
|
|
460
|
-
|
|
388
|
+
const deserializeAws_json1_0LimitExceededException = (output, context) => {
|
|
461
389
|
return {
|
|
462
390
|
message: __expectString(output.message),
|
|
463
391
|
};
|
|
464
392
|
};
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
.filter(
|
|
468
|
-
.map(
|
|
393
|
+
const deserializeAws_json1_0ListAttributeValue = (output, context) => {
|
|
394
|
+
const retVal = (output || [])
|
|
395
|
+
.filter((e) => e != null)
|
|
396
|
+
.map((entry) => {
|
|
469
397
|
if (entry === null) {
|
|
470
398
|
return null;
|
|
471
399
|
}
|
|
@@ -473,26 +401,27 @@ var deserializeAws_json1_0ListAttributeValue = function (output, context) {
|
|
|
473
401
|
});
|
|
474
402
|
return retVal;
|
|
475
403
|
};
|
|
476
|
-
|
|
404
|
+
const deserializeAws_json1_0ListStreamsOutput = (output, context) => {
|
|
477
405
|
return {
|
|
478
406
|
LastEvaluatedStreamArn: __expectString(output.LastEvaluatedStreamArn),
|
|
479
407
|
Streams: output.Streams != null ? deserializeAws_json1_0StreamList(output.Streams, context) : undefined,
|
|
480
408
|
};
|
|
481
409
|
};
|
|
482
|
-
|
|
483
|
-
return Object.entries(output).reduce(
|
|
484
|
-
var _b;
|
|
485
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
410
|
+
const deserializeAws_json1_0MapAttributeValue = (output, context) => {
|
|
411
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
486
412
|
if (value === null) {
|
|
487
413
|
return acc;
|
|
488
414
|
}
|
|
489
|
-
return
|
|
415
|
+
return {
|
|
416
|
+
...acc,
|
|
417
|
+
[key]: deserializeAws_json1_0AttributeValue(__expectUnion(value), context),
|
|
418
|
+
};
|
|
490
419
|
}, {});
|
|
491
420
|
};
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
.filter(
|
|
495
|
-
.map(
|
|
421
|
+
const deserializeAws_json1_0NumberSetAttributeValue = (output, context) => {
|
|
422
|
+
const retVal = (output || [])
|
|
423
|
+
.filter((e) => e != null)
|
|
424
|
+
.map((entry) => {
|
|
496
425
|
if (entry === null) {
|
|
497
426
|
return null;
|
|
498
427
|
}
|
|
@@ -500,7 +429,7 @@ var deserializeAws_json1_0NumberSetAttributeValue = function (output, context) {
|
|
|
500
429
|
});
|
|
501
430
|
return retVal;
|
|
502
431
|
};
|
|
503
|
-
|
|
432
|
+
const deserializeAws_json1_0_Record = (output, context) => {
|
|
504
433
|
return {
|
|
505
434
|
awsRegion: __expectString(output.awsRegion),
|
|
506
435
|
dynamodb: output.dynamodb != null ? deserializeAws_json1_0StreamRecord(output.dynamodb, context) : undefined,
|
|
@@ -511,10 +440,10 @@ var deserializeAws_json1_0_Record = function (output, context) {
|
|
|
511
440
|
userIdentity: output.userIdentity != null ? deserializeAws_json1_0Identity(output.userIdentity, context) : undefined,
|
|
512
441
|
};
|
|
513
442
|
};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
.filter(
|
|
517
|
-
.map(
|
|
443
|
+
const deserializeAws_json1_0RecordList = (output, context) => {
|
|
444
|
+
const retVal = (output || [])
|
|
445
|
+
.filter((e) => e != null)
|
|
446
|
+
.map((entry) => {
|
|
518
447
|
if (entry === null) {
|
|
519
448
|
return null;
|
|
520
449
|
}
|
|
@@ -522,18 +451,18 @@ var deserializeAws_json1_0RecordList = function (output, context) {
|
|
|
522
451
|
});
|
|
523
452
|
return retVal;
|
|
524
453
|
};
|
|
525
|
-
|
|
454
|
+
const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
|
|
526
455
|
return {
|
|
527
456
|
message: __expectString(output.message),
|
|
528
457
|
};
|
|
529
458
|
};
|
|
530
|
-
|
|
459
|
+
const deserializeAws_json1_0SequenceNumberRange = (output, context) => {
|
|
531
460
|
return {
|
|
532
461
|
EndingSequenceNumber: __expectString(output.EndingSequenceNumber),
|
|
533
462
|
StartingSequenceNumber: __expectString(output.StartingSequenceNumber),
|
|
534
463
|
};
|
|
535
464
|
};
|
|
536
|
-
|
|
465
|
+
const deserializeAws_json1_0Shard = (output, context) => {
|
|
537
466
|
return {
|
|
538
467
|
ParentShardId: __expectString(output.ParentShardId),
|
|
539
468
|
SequenceNumberRange: output.SequenceNumberRange != null
|
|
@@ -542,10 +471,10 @@ var deserializeAws_json1_0Shard = function (output, context) {
|
|
|
542
471
|
ShardId: __expectString(output.ShardId),
|
|
543
472
|
};
|
|
544
473
|
};
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
.filter(
|
|
548
|
-
.map(
|
|
474
|
+
const deserializeAws_json1_0ShardDescriptionList = (output, context) => {
|
|
475
|
+
const retVal = (output || [])
|
|
476
|
+
.filter((e) => e != null)
|
|
477
|
+
.map((entry) => {
|
|
549
478
|
if (entry === null) {
|
|
550
479
|
return null;
|
|
551
480
|
}
|
|
@@ -553,14 +482,14 @@ var deserializeAws_json1_0ShardDescriptionList = function (output, context) {
|
|
|
553
482
|
});
|
|
554
483
|
return retVal;
|
|
555
484
|
};
|
|
556
|
-
|
|
485
|
+
const deserializeAws_json1_0_Stream = (output, context) => {
|
|
557
486
|
return {
|
|
558
487
|
StreamArn: __expectString(output.StreamArn),
|
|
559
488
|
StreamLabel: __expectString(output.StreamLabel),
|
|
560
489
|
TableName: __expectString(output.TableName),
|
|
561
490
|
};
|
|
562
491
|
};
|
|
563
|
-
|
|
492
|
+
const deserializeAws_json1_0StreamDescription = (output, context) => {
|
|
564
493
|
return {
|
|
565
494
|
CreationRequestDateTime: output.CreationRequestDateTime != null
|
|
566
495
|
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationRequestDateTime)))
|
|
@@ -575,10 +504,10 @@ var deserializeAws_json1_0StreamDescription = function (output, context) {
|
|
|
575
504
|
TableName: __expectString(output.TableName),
|
|
576
505
|
};
|
|
577
506
|
};
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
.filter(
|
|
581
|
-
.map(
|
|
507
|
+
const deserializeAws_json1_0StreamList = (output, context) => {
|
|
508
|
+
const retVal = (output || [])
|
|
509
|
+
.filter((e) => e != null)
|
|
510
|
+
.map((entry) => {
|
|
582
511
|
if (entry === null) {
|
|
583
512
|
return null;
|
|
584
513
|
}
|
|
@@ -586,7 +515,7 @@ var deserializeAws_json1_0StreamList = function (output, context) {
|
|
|
586
515
|
});
|
|
587
516
|
return retVal;
|
|
588
517
|
};
|
|
589
|
-
|
|
518
|
+
const deserializeAws_json1_0StreamRecord = (output, context) => {
|
|
590
519
|
return {
|
|
591
520
|
ApproximateCreationDateTime: output.ApproximateCreationDateTime != null
|
|
592
521
|
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ApproximateCreationDateTime)))
|
|
@@ -599,10 +528,10 @@ var deserializeAws_json1_0StreamRecord = function (output, context) {
|
|
|
599
528
|
StreamViewType: __expectString(output.StreamViewType),
|
|
600
529
|
};
|
|
601
530
|
};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
.filter(
|
|
605
|
-
.map(
|
|
531
|
+
const deserializeAws_json1_0StringSetAttributeValue = (output, context) => {
|
|
532
|
+
const retVal = (output || [])
|
|
533
|
+
.filter((e) => e != null)
|
|
534
|
+
.map((entry) => {
|
|
606
535
|
if (entry === null) {
|
|
607
536
|
return null;
|
|
608
537
|
}
|
|
@@ -610,80 +539,57 @@ var deserializeAws_json1_0StringSetAttributeValue = function (output, context) {
|
|
|
610
539
|
});
|
|
611
540
|
return retVal;
|
|
612
541
|
};
|
|
613
|
-
|
|
542
|
+
const deserializeAws_json1_0TrimmedDataAccessException = (output, context) => {
|
|
614
543
|
return {
|
|
615
544
|
message: __expectString(output.message),
|
|
616
545
|
};
|
|
617
546
|
};
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
});
|
|
626
|
-
};
|
|
627
|
-
var collectBody = function (streamBody, context) {
|
|
628
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
547
|
+
const deserializeMetadata = (output) => ({
|
|
548
|
+
httpStatusCode: output.statusCode,
|
|
549
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
550
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
551
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
552
|
+
});
|
|
553
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
629
554
|
if (streamBody instanceof Uint8Array) {
|
|
630
555
|
return Promise.resolve(streamBody);
|
|
631
556
|
}
|
|
632
557
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
633
558
|
};
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
if (resolvedHostname !== undefined) {
|
|
653
|
-
contents.hostname = resolvedHostname;
|
|
654
|
-
}
|
|
655
|
-
if (body !== undefined) {
|
|
656
|
-
contents.body = body;
|
|
657
|
-
}
|
|
658
|
-
return [2, new __HttpRequest(contents)];
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
}); };
|
|
662
|
-
var parseBody = function (streamBody, context) {
|
|
663
|
-
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
664
|
-
if (encoded.length) {
|
|
665
|
-
return JSON.parse(encoded);
|
|
666
|
-
}
|
|
667
|
-
return {};
|
|
668
|
-
});
|
|
559
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
560
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
561
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
562
|
+
const contents = {
|
|
563
|
+
protocol,
|
|
564
|
+
hostname,
|
|
565
|
+
port,
|
|
566
|
+
method: "POST",
|
|
567
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
568
|
+
headers,
|
|
569
|
+
};
|
|
570
|
+
if (resolvedHostname !== undefined) {
|
|
571
|
+
contents.hostname = resolvedHostname;
|
|
572
|
+
}
|
|
573
|
+
if (body !== undefined) {
|
|
574
|
+
contents.body = body;
|
|
575
|
+
}
|
|
576
|
+
return new __HttpRequest(contents);
|
|
669
577
|
};
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
686
|
-
var cleanValue = rawValue;
|
|
578
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
579
|
+
if (encoded.length) {
|
|
580
|
+
return JSON.parse(encoded);
|
|
581
|
+
}
|
|
582
|
+
return {};
|
|
583
|
+
});
|
|
584
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
585
|
+
const value = await parseBody(errorBody, context);
|
|
586
|
+
value.message = value.message ?? value.Message;
|
|
587
|
+
return value;
|
|
588
|
+
};
|
|
589
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
590
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
591
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
592
|
+
let cleanValue = rawValue;
|
|
687
593
|
if (typeof cleanValue === "number") {
|
|
688
594
|
cleanValue = cleanValue.toString();
|
|
689
595
|
}
|
|
@@ -698,7 +604,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
698
604
|
}
|
|
699
605
|
return cleanValue;
|
|
700
606
|
};
|
|
701
|
-
|
|
607
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
702
608
|
if (headerKey !== undefined) {
|
|
703
609
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
704
610
|
}
|