@aws-sdk/client-sqs 3.490.0 → 3.495.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.
Files changed (40) hide show
  1. package/dist-cjs/SQS.js +1 -57
  2. package/dist-cjs/SQSClient.js +1 -56
  3. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +1 -43
  4. package/dist-cjs/commands/AddPermissionCommand.js +1 -28
  5. package/dist-cjs/commands/CancelMessageMoveTaskCommand.js +1 -28
  6. package/dist-cjs/commands/ChangeMessageVisibilityBatchCommand.js +1 -28
  7. package/dist-cjs/commands/ChangeMessageVisibilityCommand.js +1 -28
  8. package/dist-cjs/commands/CreateQueueCommand.js +1 -28
  9. package/dist-cjs/commands/DeleteMessageBatchCommand.js +1 -28
  10. package/dist-cjs/commands/DeleteMessageCommand.js +1 -28
  11. package/dist-cjs/commands/DeleteQueueCommand.js +1 -28
  12. package/dist-cjs/commands/GetQueueAttributesCommand.js +1 -28
  13. package/dist-cjs/commands/GetQueueUrlCommand.js +1 -28
  14. package/dist-cjs/commands/ListDeadLetterSourceQueuesCommand.js +1 -28
  15. package/dist-cjs/commands/ListMessageMoveTasksCommand.js +1 -28
  16. package/dist-cjs/commands/ListQueueTagsCommand.js +1 -28
  17. package/dist-cjs/commands/ListQueuesCommand.js +1 -28
  18. package/dist-cjs/commands/PurgeQueueCommand.js +1 -28
  19. package/dist-cjs/commands/ReceiveMessageCommand.js +1 -30
  20. package/dist-cjs/commands/RemovePermissionCommand.js +1 -28
  21. package/dist-cjs/commands/SendMessageBatchCommand.js +1 -30
  22. package/dist-cjs/commands/SendMessageCommand.js +1 -30
  23. package/dist-cjs/commands/SetQueueAttributesCommand.js +1 -28
  24. package/dist-cjs/commands/StartMessageMoveTaskCommand.js +1 -28
  25. package/dist-cjs/commands/TagQueueCommand.js +1 -28
  26. package/dist-cjs/commands/UntagQueueCommand.js +1 -28
  27. package/dist-cjs/commands/index.js +1 -26
  28. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  29. package/dist-cjs/extensionConfiguration.js +1 -2
  30. package/dist-cjs/index.js +3223 -11
  31. package/dist-cjs/models/SQSServiceException.js +1 -12
  32. package/dist-cjs/models/index.js +1 -4
  33. package/dist-cjs/models/models_0.js +1 -406
  34. package/dist-cjs/pagination/Interfaces.js +1 -2
  35. package/dist-cjs/pagination/ListDeadLetterSourceQueuesPaginator.js +1 -7
  36. package/dist-cjs/pagination/ListQueuesPaginator.js +1 -7
  37. package/dist-cjs/pagination/index.js +1 -6
  38. package/dist-cjs/protocols/Aws_json1_0.js +1 -2025
  39. package/dist-cjs/runtimeExtensions.js +1 -25
  40. package/package.json +42 -42
@@ -1,2025 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UntagQueueCommand = exports.de_TagQueueCommand = exports.de_StartMessageMoveTaskCommand = exports.de_SetQueueAttributesCommand = exports.de_SendMessageBatchCommand = exports.de_SendMessageCommand = exports.de_RemovePermissionCommand = exports.de_ReceiveMessageCommand = exports.de_PurgeQueueCommand = exports.de_ListQueueTagsCommand = exports.de_ListQueuesCommand = exports.de_ListMessageMoveTasksCommand = exports.de_ListDeadLetterSourceQueuesCommand = exports.de_GetQueueUrlCommand = exports.de_GetQueueAttributesCommand = exports.de_DeleteQueueCommand = exports.de_DeleteMessageBatchCommand = exports.de_DeleteMessageCommand = exports.de_CreateQueueCommand = exports.de_ChangeMessageVisibilityBatchCommand = exports.de_ChangeMessageVisibilityCommand = exports.de_CancelMessageMoveTaskCommand = exports.de_AddPermissionCommand = exports.se_UntagQueueCommand = exports.se_TagQueueCommand = exports.se_StartMessageMoveTaskCommand = exports.se_SetQueueAttributesCommand = exports.se_SendMessageBatchCommand = exports.se_SendMessageCommand = exports.se_RemovePermissionCommand = exports.se_ReceiveMessageCommand = exports.se_PurgeQueueCommand = exports.se_ListQueueTagsCommand = exports.se_ListQueuesCommand = exports.se_ListMessageMoveTasksCommand = exports.se_ListDeadLetterSourceQueuesCommand = exports.se_GetQueueUrlCommand = exports.se_GetQueueAttributesCommand = exports.se_DeleteQueueCommand = exports.se_DeleteMessageBatchCommand = exports.se_DeleteMessageCommand = exports.se_CreateQueueCommand = exports.se_ChangeMessageVisibilityBatchCommand = exports.se_ChangeMessageVisibilityCommand = exports.se_CancelMessageMoveTaskCommand = exports.se_AddPermissionCommand = void 0;
4
- const core_1 = require("@aws-sdk/core");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const models_0_1 = require("../models/models_0");
8
- const SQSServiceException_1 = require("../models/SQSServiceException");
9
- const se_AddPermissionCommand = async (input, context) => {
10
- const headers = sharedHeaders("AddPermission");
11
- let body;
12
- body = JSON.stringify(se_AddPermissionRequest(input, context));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_AddPermissionCommand = se_AddPermissionCommand;
16
- const se_CancelMessageMoveTaskCommand = async (input, context) => {
17
- const headers = sharedHeaders("CancelMessageMoveTask");
18
- let body;
19
- body = JSON.stringify(se_CancelMessageMoveTaskRequest(input, context));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_CancelMessageMoveTaskCommand = se_CancelMessageMoveTaskCommand;
23
- const se_ChangeMessageVisibilityCommand = async (input, context) => {
24
- const headers = sharedHeaders("ChangeMessageVisibility");
25
- let body;
26
- body = JSON.stringify(se_ChangeMessageVisibilityRequest(input, context));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_ChangeMessageVisibilityCommand = se_ChangeMessageVisibilityCommand;
30
- const se_ChangeMessageVisibilityBatchCommand = async (input, context) => {
31
- const headers = sharedHeaders("ChangeMessageVisibilityBatch");
32
- let body;
33
- body = JSON.stringify(se_ChangeMessageVisibilityBatchRequest(input, context));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_ChangeMessageVisibilityBatchCommand = se_ChangeMessageVisibilityBatchCommand;
37
- const se_CreateQueueCommand = async (input, context) => {
38
- const headers = sharedHeaders("CreateQueue");
39
- let body;
40
- body = JSON.stringify(se_CreateQueueRequest(input, context));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- exports.se_CreateQueueCommand = se_CreateQueueCommand;
44
- const se_DeleteMessageCommand = async (input, context) => {
45
- const headers = sharedHeaders("DeleteMessage");
46
- let body;
47
- body = JSON.stringify(se_DeleteMessageRequest(input, context));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- exports.se_DeleteMessageCommand = se_DeleteMessageCommand;
51
- const se_DeleteMessageBatchCommand = async (input, context) => {
52
- const headers = sharedHeaders("DeleteMessageBatch");
53
- let body;
54
- body = JSON.stringify(se_DeleteMessageBatchRequest(input, context));
55
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
- };
57
- exports.se_DeleteMessageBatchCommand = se_DeleteMessageBatchCommand;
58
- const se_DeleteQueueCommand = async (input, context) => {
59
- const headers = sharedHeaders("DeleteQueue");
60
- let body;
61
- body = JSON.stringify(se_DeleteQueueRequest(input, context));
62
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
63
- };
64
- exports.se_DeleteQueueCommand = se_DeleteQueueCommand;
65
- const se_GetQueueAttributesCommand = async (input, context) => {
66
- const headers = sharedHeaders("GetQueueAttributes");
67
- let body;
68
- body = JSON.stringify(se_GetQueueAttributesRequest(input, context));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- exports.se_GetQueueAttributesCommand = se_GetQueueAttributesCommand;
72
- const se_GetQueueUrlCommand = async (input, context) => {
73
- const headers = sharedHeaders("GetQueueUrl");
74
- let body;
75
- body = JSON.stringify(se_GetQueueUrlRequest(input, context));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- exports.se_GetQueueUrlCommand = se_GetQueueUrlCommand;
79
- const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
80
- const headers = sharedHeaders("ListDeadLetterSourceQueues");
81
- let body;
82
- body = JSON.stringify(se_ListDeadLetterSourceQueuesRequest(input, context));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- exports.se_ListDeadLetterSourceQueuesCommand = se_ListDeadLetterSourceQueuesCommand;
86
- const se_ListMessageMoveTasksCommand = async (input, context) => {
87
- const headers = sharedHeaders("ListMessageMoveTasks");
88
- let body;
89
- body = JSON.stringify(se_ListMessageMoveTasksRequest(input, context));
90
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
91
- };
92
- exports.se_ListMessageMoveTasksCommand = se_ListMessageMoveTasksCommand;
93
- const se_ListQueuesCommand = async (input, context) => {
94
- const headers = sharedHeaders("ListQueues");
95
- let body;
96
- body = JSON.stringify(se_ListQueuesRequest(input, context));
97
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
98
- };
99
- exports.se_ListQueuesCommand = se_ListQueuesCommand;
100
- const se_ListQueueTagsCommand = async (input, context) => {
101
- const headers = sharedHeaders("ListQueueTags");
102
- let body;
103
- body = JSON.stringify(se_ListQueueTagsRequest(input, context));
104
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
105
- };
106
- exports.se_ListQueueTagsCommand = se_ListQueueTagsCommand;
107
- const se_PurgeQueueCommand = async (input, context) => {
108
- const headers = sharedHeaders("PurgeQueue");
109
- let body;
110
- body = JSON.stringify(se_PurgeQueueRequest(input, context));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- exports.se_PurgeQueueCommand = se_PurgeQueueCommand;
114
- const se_ReceiveMessageCommand = async (input, context) => {
115
- const headers = sharedHeaders("ReceiveMessage");
116
- let body;
117
- body = JSON.stringify(se_ReceiveMessageRequest(input, context));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- exports.se_ReceiveMessageCommand = se_ReceiveMessageCommand;
121
- const se_RemovePermissionCommand = async (input, context) => {
122
- const headers = sharedHeaders("RemovePermission");
123
- let body;
124
- body = JSON.stringify(se_RemovePermissionRequest(input, context));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- exports.se_RemovePermissionCommand = se_RemovePermissionCommand;
128
- const se_SendMessageCommand = async (input, context) => {
129
- const headers = sharedHeaders("SendMessage");
130
- let body;
131
- body = JSON.stringify(se_SendMessageRequest(input, context));
132
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
133
- };
134
- exports.se_SendMessageCommand = se_SendMessageCommand;
135
- const se_SendMessageBatchCommand = async (input, context) => {
136
- const headers = sharedHeaders("SendMessageBatch");
137
- let body;
138
- body = JSON.stringify(se_SendMessageBatchRequest(input, context));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- exports.se_SendMessageBatchCommand = se_SendMessageBatchCommand;
142
- const se_SetQueueAttributesCommand = async (input, context) => {
143
- const headers = sharedHeaders("SetQueueAttributes");
144
- let body;
145
- body = JSON.stringify(se_SetQueueAttributesRequest(input, context));
146
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
- };
148
- exports.se_SetQueueAttributesCommand = se_SetQueueAttributesCommand;
149
- const se_StartMessageMoveTaskCommand = async (input, context) => {
150
- const headers = sharedHeaders("StartMessageMoveTask");
151
- let body;
152
- body = JSON.stringify(se_StartMessageMoveTaskRequest(input, context));
153
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
154
- };
155
- exports.se_StartMessageMoveTaskCommand = se_StartMessageMoveTaskCommand;
156
- const se_TagQueueCommand = async (input, context) => {
157
- const headers = sharedHeaders("TagQueue");
158
- let body;
159
- body = JSON.stringify(se_TagQueueRequest(input, context));
160
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
- };
162
- exports.se_TagQueueCommand = se_TagQueueCommand;
163
- const se_UntagQueueCommand = async (input, context) => {
164
- const headers = sharedHeaders("UntagQueue");
165
- let body;
166
- body = JSON.stringify(se_UntagQueueRequest(input, context));
167
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
168
- };
169
- exports.se_UntagQueueCommand = se_UntagQueueCommand;
170
- const de_AddPermissionCommand = async (output, context) => {
171
- if (output.statusCode >= 300) {
172
- return de_AddPermissionCommandError(output, context);
173
- }
174
- await (0, smithy_client_1.collectBody)(output.body, context);
175
- const response = {
176
- $metadata: deserializeMetadata(output),
177
- };
178
- return response;
179
- };
180
- exports.de_AddPermissionCommand = de_AddPermissionCommand;
181
- const de_AddPermissionCommandError = async (output, context) => {
182
- const parsedOutput = {
183
- ...output,
184
- body: await parseErrorBody(output.body, context),
185
- };
186
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
187
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
188
- switch (errorCode) {
189
- case "InvalidAddress":
190
- case "com.amazonaws.sqs#InvalidAddress":
191
- throw await de_InvalidAddressRes(parsedOutput, context);
192
- case "InvalidSecurity":
193
- case "com.amazonaws.sqs#InvalidSecurity":
194
- throw await de_InvalidSecurityRes(parsedOutput, context);
195
- case "OverLimit":
196
- case "com.amazonaws.sqs#OverLimit":
197
- throw await de_OverLimitRes(parsedOutput, context);
198
- case "QueueDoesNotExist":
199
- case "com.amazonaws.sqs#QueueDoesNotExist":
200
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
201
- case "RequestThrottled":
202
- case "com.amazonaws.sqs#RequestThrottled":
203
- throw await de_RequestThrottledRes(parsedOutput, context);
204
- case "UnsupportedOperation":
205
- case "com.amazonaws.sqs#UnsupportedOperation":
206
- throw await de_UnsupportedOperationRes(parsedOutput, context);
207
- default:
208
- const parsedBody = parsedOutput.body;
209
- return throwDefaultError({
210
- output,
211
- parsedBody,
212
- errorCode,
213
- });
214
- }
215
- };
216
- const de_CancelMessageMoveTaskCommand = async (output, context) => {
217
- if (output.statusCode >= 300) {
218
- return de_CancelMessageMoveTaskCommandError(output, context);
219
- }
220
- const data = await parseBody(output.body, context);
221
- let contents = {};
222
- contents = (0, smithy_client_1._json)(data);
223
- const response = {
224
- $metadata: deserializeMetadata(output),
225
- ...contents,
226
- };
227
- return response;
228
- };
229
- exports.de_CancelMessageMoveTaskCommand = de_CancelMessageMoveTaskCommand;
230
- const de_CancelMessageMoveTaskCommandError = async (output, context) => {
231
- const parsedOutput = {
232
- ...output,
233
- body: await parseErrorBody(output.body, context),
234
- };
235
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
236
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
237
- switch (errorCode) {
238
- case "InvalidAddress":
239
- case "com.amazonaws.sqs#InvalidAddress":
240
- throw await de_InvalidAddressRes(parsedOutput, context);
241
- case "InvalidSecurity":
242
- case "com.amazonaws.sqs#InvalidSecurity":
243
- throw await de_InvalidSecurityRes(parsedOutput, context);
244
- case "RequestThrottled":
245
- case "com.amazonaws.sqs#RequestThrottled":
246
- throw await de_RequestThrottledRes(parsedOutput, context);
247
- case "ResourceNotFoundException":
248
- case "com.amazonaws.sqs#ResourceNotFoundException":
249
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
250
- case "UnsupportedOperation":
251
- case "com.amazonaws.sqs#UnsupportedOperation":
252
- throw await de_UnsupportedOperationRes(parsedOutput, context);
253
- default:
254
- const parsedBody = parsedOutput.body;
255
- return throwDefaultError({
256
- output,
257
- parsedBody,
258
- errorCode,
259
- });
260
- }
261
- };
262
- const de_ChangeMessageVisibilityCommand = async (output, context) => {
263
- if (output.statusCode >= 300) {
264
- return de_ChangeMessageVisibilityCommandError(output, context);
265
- }
266
- await (0, smithy_client_1.collectBody)(output.body, context);
267
- const response = {
268
- $metadata: deserializeMetadata(output),
269
- };
270
- return response;
271
- };
272
- exports.de_ChangeMessageVisibilityCommand = de_ChangeMessageVisibilityCommand;
273
- const de_ChangeMessageVisibilityCommandError = async (output, context) => {
274
- const parsedOutput = {
275
- ...output,
276
- body: await parseErrorBody(output.body, context),
277
- };
278
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
279
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
280
- switch (errorCode) {
281
- case "InvalidAddress":
282
- case "com.amazonaws.sqs#InvalidAddress":
283
- throw await de_InvalidAddressRes(parsedOutput, context);
284
- case "InvalidSecurity":
285
- case "com.amazonaws.sqs#InvalidSecurity":
286
- throw await de_InvalidSecurityRes(parsedOutput, context);
287
- case "MessageNotInflight":
288
- case "com.amazonaws.sqs#MessageNotInflight":
289
- throw await de_MessageNotInflightRes(parsedOutput, context);
290
- case "QueueDoesNotExist":
291
- case "com.amazonaws.sqs#QueueDoesNotExist":
292
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
293
- case "ReceiptHandleIsInvalid":
294
- case "com.amazonaws.sqs#ReceiptHandleIsInvalid":
295
- throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
296
- case "RequestThrottled":
297
- case "com.amazonaws.sqs#RequestThrottled":
298
- throw await de_RequestThrottledRes(parsedOutput, context);
299
- case "UnsupportedOperation":
300
- case "com.amazonaws.sqs#UnsupportedOperation":
301
- throw await de_UnsupportedOperationRes(parsedOutput, context);
302
- default:
303
- const parsedBody = parsedOutput.body;
304
- return throwDefaultError({
305
- output,
306
- parsedBody,
307
- errorCode,
308
- });
309
- }
310
- };
311
- const de_ChangeMessageVisibilityBatchCommand = async (output, context) => {
312
- if (output.statusCode >= 300) {
313
- return de_ChangeMessageVisibilityBatchCommandError(output, context);
314
- }
315
- const data = await parseBody(output.body, context);
316
- let contents = {};
317
- contents = (0, smithy_client_1._json)(data);
318
- const response = {
319
- $metadata: deserializeMetadata(output),
320
- ...contents,
321
- };
322
- return response;
323
- };
324
- exports.de_ChangeMessageVisibilityBatchCommand = de_ChangeMessageVisibilityBatchCommand;
325
- const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
326
- const parsedOutput = {
327
- ...output,
328
- body: await parseErrorBody(output.body, context),
329
- };
330
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
331
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
332
- switch (errorCode) {
333
- case "BatchEntryIdsNotDistinct":
334
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
335
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
336
- case "EmptyBatchRequest":
337
- case "com.amazonaws.sqs#EmptyBatchRequest":
338
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
339
- case "InvalidAddress":
340
- case "com.amazonaws.sqs#InvalidAddress":
341
- throw await de_InvalidAddressRes(parsedOutput, context);
342
- case "InvalidBatchEntryId":
343
- case "com.amazonaws.sqs#InvalidBatchEntryId":
344
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
345
- case "InvalidSecurity":
346
- case "com.amazonaws.sqs#InvalidSecurity":
347
- throw await de_InvalidSecurityRes(parsedOutput, context);
348
- case "QueueDoesNotExist":
349
- case "com.amazonaws.sqs#QueueDoesNotExist":
350
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
351
- case "RequestThrottled":
352
- case "com.amazonaws.sqs#RequestThrottled":
353
- throw await de_RequestThrottledRes(parsedOutput, context);
354
- case "TooManyEntriesInBatchRequest":
355
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
356
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
357
- case "UnsupportedOperation":
358
- case "com.amazonaws.sqs#UnsupportedOperation":
359
- throw await de_UnsupportedOperationRes(parsedOutput, context);
360
- default:
361
- const parsedBody = parsedOutput.body;
362
- return throwDefaultError({
363
- output,
364
- parsedBody,
365
- errorCode,
366
- });
367
- }
368
- };
369
- const de_CreateQueueCommand = async (output, context) => {
370
- if (output.statusCode >= 300) {
371
- return de_CreateQueueCommandError(output, context);
372
- }
373
- const data = await parseBody(output.body, context);
374
- let contents = {};
375
- contents = (0, smithy_client_1._json)(data);
376
- const response = {
377
- $metadata: deserializeMetadata(output),
378
- ...contents,
379
- };
380
- return response;
381
- };
382
- exports.de_CreateQueueCommand = de_CreateQueueCommand;
383
- const de_CreateQueueCommandError = async (output, context) => {
384
- const parsedOutput = {
385
- ...output,
386
- body: await parseErrorBody(output.body, context),
387
- };
388
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
389
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
390
- switch (errorCode) {
391
- case "InvalidAddress":
392
- case "com.amazonaws.sqs#InvalidAddress":
393
- throw await de_InvalidAddressRes(parsedOutput, context);
394
- case "InvalidAttributeName":
395
- case "com.amazonaws.sqs#InvalidAttributeName":
396
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
397
- case "InvalidAttributeValue":
398
- case "com.amazonaws.sqs#InvalidAttributeValue":
399
- throw await de_InvalidAttributeValueRes(parsedOutput, context);
400
- case "InvalidSecurity":
401
- case "com.amazonaws.sqs#InvalidSecurity":
402
- throw await de_InvalidSecurityRes(parsedOutput, context);
403
- case "QueueDeletedRecently":
404
- case "com.amazonaws.sqs#QueueDeletedRecently":
405
- throw await de_QueueDeletedRecentlyRes(parsedOutput, context);
406
- case "QueueNameExists":
407
- case "com.amazonaws.sqs#QueueNameExists":
408
- throw await de_QueueNameExistsRes(parsedOutput, context);
409
- case "RequestThrottled":
410
- case "com.amazonaws.sqs#RequestThrottled":
411
- throw await de_RequestThrottledRes(parsedOutput, context);
412
- case "UnsupportedOperation":
413
- case "com.amazonaws.sqs#UnsupportedOperation":
414
- throw await de_UnsupportedOperationRes(parsedOutput, context);
415
- default:
416
- const parsedBody = parsedOutput.body;
417
- return throwDefaultError({
418
- output,
419
- parsedBody,
420
- errorCode,
421
- });
422
- }
423
- };
424
- const de_DeleteMessageCommand = async (output, context) => {
425
- if (output.statusCode >= 300) {
426
- return de_DeleteMessageCommandError(output, context);
427
- }
428
- await (0, smithy_client_1.collectBody)(output.body, context);
429
- const response = {
430
- $metadata: deserializeMetadata(output),
431
- };
432
- return response;
433
- };
434
- exports.de_DeleteMessageCommand = de_DeleteMessageCommand;
435
- const de_DeleteMessageCommandError = async (output, context) => {
436
- const parsedOutput = {
437
- ...output,
438
- body: await parseErrorBody(output.body, context),
439
- };
440
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
441
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
- switch (errorCode) {
443
- case "InvalidAddress":
444
- case "com.amazonaws.sqs#InvalidAddress":
445
- throw await de_InvalidAddressRes(parsedOutput, context);
446
- case "InvalidIdFormat":
447
- case "com.amazonaws.sqs#InvalidIdFormat":
448
- throw await de_InvalidIdFormatRes(parsedOutput, context);
449
- case "InvalidSecurity":
450
- case "com.amazonaws.sqs#InvalidSecurity":
451
- throw await de_InvalidSecurityRes(parsedOutput, context);
452
- case "QueueDoesNotExist":
453
- case "com.amazonaws.sqs#QueueDoesNotExist":
454
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
455
- case "ReceiptHandleIsInvalid":
456
- case "com.amazonaws.sqs#ReceiptHandleIsInvalid":
457
- throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
458
- case "RequestThrottled":
459
- case "com.amazonaws.sqs#RequestThrottled":
460
- throw await de_RequestThrottledRes(parsedOutput, context);
461
- case "UnsupportedOperation":
462
- case "com.amazonaws.sqs#UnsupportedOperation":
463
- throw await de_UnsupportedOperationRes(parsedOutput, context);
464
- default:
465
- const parsedBody = parsedOutput.body;
466
- return throwDefaultError({
467
- output,
468
- parsedBody,
469
- errorCode,
470
- });
471
- }
472
- };
473
- const de_DeleteMessageBatchCommand = async (output, context) => {
474
- if (output.statusCode >= 300) {
475
- return de_DeleteMessageBatchCommandError(output, context);
476
- }
477
- const data = await parseBody(output.body, context);
478
- let contents = {};
479
- contents = (0, smithy_client_1._json)(data);
480
- const response = {
481
- $metadata: deserializeMetadata(output),
482
- ...contents,
483
- };
484
- return response;
485
- };
486
- exports.de_DeleteMessageBatchCommand = de_DeleteMessageBatchCommand;
487
- const de_DeleteMessageBatchCommandError = async (output, context) => {
488
- const parsedOutput = {
489
- ...output,
490
- body: await parseErrorBody(output.body, context),
491
- };
492
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
493
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
494
- switch (errorCode) {
495
- case "BatchEntryIdsNotDistinct":
496
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
497
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
498
- case "EmptyBatchRequest":
499
- case "com.amazonaws.sqs#EmptyBatchRequest":
500
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
501
- case "InvalidAddress":
502
- case "com.amazonaws.sqs#InvalidAddress":
503
- throw await de_InvalidAddressRes(parsedOutput, context);
504
- case "InvalidBatchEntryId":
505
- case "com.amazonaws.sqs#InvalidBatchEntryId":
506
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
507
- case "InvalidSecurity":
508
- case "com.amazonaws.sqs#InvalidSecurity":
509
- throw await de_InvalidSecurityRes(parsedOutput, context);
510
- case "QueueDoesNotExist":
511
- case "com.amazonaws.sqs#QueueDoesNotExist":
512
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
513
- case "RequestThrottled":
514
- case "com.amazonaws.sqs#RequestThrottled":
515
- throw await de_RequestThrottledRes(parsedOutput, context);
516
- case "TooManyEntriesInBatchRequest":
517
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
518
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
519
- case "UnsupportedOperation":
520
- case "com.amazonaws.sqs#UnsupportedOperation":
521
- throw await de_UnsupportedOperationRes(parsedOutput, context);
522
- default:
523
- const parsedBody = parsedOutput.body;
524
- return throwDefaultError({
525
- output,
526
- parsedBody,
527
- errorCode,
528
- });
529
- }
530
- };
531
- const de_DeleteQueueCommand = async (output, context) => {
532
- if (output.statusCode >= 300) {
533
- return de_DeleteQueueCommandError(output, context);
534
- }
535
- await (0, smithy_client_1.collectBody)(output.body, context);
536
- const response = {
537
- $metadata: deserializeMetadata(output),
538
- };
539
- return response;
540
- };
541
- exports.de_DeleteQueueCommand = de_DeleteQueueCommand;
542
- const de_DeleteQueueCommandError = async (output, context) => {
543
- const parsedOutput = {
544
- ...output,
545
- body: await parseErrorBody(output.body, context),
546
- };
547
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
548
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
549
- switch (errorCode) {
550
- case "InvalidAddress":
551
- case "com.amazonaws.sqs#InvalidAddress":
552
- throw await de_InvalidAddressRes(parsedOutput, context);
553
- case "InvalidSecurity":
554
- case "com.amazonaws.sqs#InvalidSecurity":
555
- throw await de_InvalidSecurityRes(parsedOutput, context);
556
- case "QueueDoesNotExist":
557
- case "com.amazonaws.sqs#QueueDoesNotExist":
558
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
559
- case "RequestThrottled":
560
- case "com.amazonaws.sqs#RequestThrottled":
561
- throw await de_RequestThrottledRes(parsedOutput, context);
562
- case "UnsupportedOperation":
563
- case "com.amazonaws.sqs#UnsupportedOperation":
564
- throw await de_UnsupportedOperationRes(parsedOutput, context);
565
- default:
566
- const parsedBody = parsedOutput.body;
567
- return throwDefaultError({
568
- output,
569
- parsedBody,
570
- errorCode,
571
- });
572
- }
573
- };
574
- const de_GetQueueAttributesCommand = async (output, context) => {
575
- if (output.statusCode >= 300) {
576
- return de_GetQueueAttributesCommandError(output, context);
577
- }
578
- const data = await parseBody(output.body, context);
579
- let contents = {};
580
- contents = (0, smithy_client_1._json)(data);
581
- const response = {
582
- $metadata: deserializeMetadata(output),
583
- ...contents,
584
- };
585
- return response;
586
- };
587
- exports.de_GetQueueAttributesCommand = de_GetQueueAttributesCommand;
588
- const de_GetQueueAttributesCommandError = async (output, context) => {
589
- const parsedOutput = {
590
- ...output,
591
- body: await parseErrorBody(output.body, context),
592
- };
593
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
594
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
595
- switch (errorCode) {
596
- case "InvalidAddress":
597
- case "com.amazonaws.sqs#InvalidAddress":
598
- throw await de_InvalidAddressRes(parsedOutput, context);
599
- case "InvalidAttributeName":
600
- case "com.amazonaws.sqs#InvalidAttributeName":
601
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
602
- case "InvalidSecurity":
603
- case "com.amazonaws.sqs#InvalidSecurity":
604
- throw await de_InvalidSecurityRes(parsedOutput, context);
605
- case "QueueDoesNotExist":
606
- case "com.amazonaws.sqs#QueueDoesNotExist":
607
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
608
- case "RequestThrottled":
609
- case "com.amazonaws.sqs#RequestThrottled":
610
- throw await de_RequestThrottledRes(parsedOutput, context);
611
- case "UnsupportedOperation":
612
- case "com.amazonaws.sqs#UnsupportedOperation":
613
- throw await de_UnsupportedOperationRes(parsedOutput, context);
614
- default:
615
- const parsedBody = parsedOutput.body;
616
- return throwDefaultError({
617
- output,
618
- parsedBody,
619
- errorCode,
620
- });
621
- }
622
- };
623
- const de_GetQueueUrlCommand = async (output, context) => {
624
- if (output.statusCode >= 300) {
625
- return de_GetQueueUrlCommandError(output, context);
626
- }
627
- const data = await parseBody(output.body, context);
628
- let contents = {};
629
- contents = (0, smithy_client_1._json)(data);
630
- const response = {
631
- $metadata: deserializeMetadata(output),
632
- ...contents,
633
- };
634
- return response;
635
- };
636
- exports.de_GetQueueUrlCommand = de_GetQueueUrlCommand;
637
- const de_GetQueueUrlCommandError = async (output, context) => {
638
- const parsedOutput = {
639
- ...output,
640
- body: await parseErrorBody(output.body, context),
641
- };
642
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
643
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
644
- switch (errorCode) {
645
- case "InvalidAddress":
646
- case "com.amazonaws.sqs#InvalidAddress":
647
- throw await de_InvalidAddressRes(parsedOutput, context);
648
- case "InvalidSecurity":
649
- case "com.amazonaws.sqs#InvalidSecurity":
650
- throw await de_InvalidSecurityRes(parsedOutput, context);
651
- case "QueueDoesNotExist":
652
- case "com.amazonaws.sqs#QueueDoesNotExist":
653
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
654
- case "RequestThrottled":
655
- case "com.amazonaws.sqs#RequestThrottled":
656
- throw await de_RequestThrottledRes(parsedOutput, context);
657
- case "UnsupportedOperation":
658
- case "com.amazonaws.sqs#UnsupportedOperation":
659
- throw await de_UnsupportedOperationRes(parsedOutput, context);
660
- default:
661
- const parsedBody = parsedOutput.body;
662
- return throwDefaultError({
663
- output,
664
- parsedBody,
665
- errorCode,
666
- });
667
- }
668
- };
669
- const de_ListDeadLetterSourceQueuesCommand = async (output, context) => {
670
- if (output.statusCode >= 300) {
671
- return de_ListDeadLetterSourceQueuesCommandError(output, context);
672
- }
673
- const data = await parseBody(output.body, context);
674
- let contents = {};
675
- contents = (0, smithy_client_1._json)(data);
676
- const response = {
677
- $metadata: deserializeMetadata(output),
678
- ...contents,
679
- };
680
- return response;
681
- };
682
- exports.de_ListDeadLetterSourceQueuesCommand = de_ListDeadLetterSourceQueuesCommand;
683
- const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
684
- const parsedOutput = {
685
- ...output,
686
- body: await parseErrorBody(output.body, context),
687
- };
688
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
689
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
- switch (errorCode) {
691
- case "InvalidAddress":
692
- case "com.amazonaws.sqs#InvalidAddress":
693
- throw await de_InvalidAddressRes(parsedOutput, context);
694
- case "InvalidSecurity":
695
- case "com.amazonaws.sqs#InvalidSecurity":
696
- throw await de_InvalidSecurityRes(parsedOutput, context);
697
- case "QueueDoesNotExist":
698
- case "com.amazonaws.sqs#QueueDoesNotExist":
699
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
700
- case "RequestThrottled":
701
- case "com.amazonaws.sqs#RequestThrottled":
702
- throw await de_RequestThrottledRes(parsedOutput, context);
703
- case "UnsupportedOperation":
704
- case "com.amazonaws.sqs#UnsupportedOperation":
705
- throw await de_UnsupportedOperationRes(parsedOutput, context);
706
- default:
707
- const parsedBody = parsedOutput.body;
708
- return throwDefaultError({
709
- output,
710
- parsedBody,
711
- errorCode,
712
- });
713
- }
714
- };
715
- const de_ListMessageMoveTasksCommand = async (output, context) => {
716
- if (output.statusCode >= 300) {
717
- return de_ListMessageMoveTasksCommandError(output, context);
718
- }
719
- const data = await parseBody(output.body, context);
720
- let contents = {};
721
- contents = (0, smithy_client_1._json)(data);
722
- const response = {
723
- $metadata: deserializeMetadata(output),
724
- ...contents,
725
- };
726
- return response;
727
- };
728
- exports.de_ListMessageMoveTasksCommand = de_ListMessageMoveTasksCommand;
729
- const de_ListMessageMoveTasksCommandError = async (output, context) => {
730
- const parsedOutput = {
731
- ...output,
732
- body: await parseErrorBody(output.body, context),
733
- };
734
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
735
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
736
- switch (errorCode) {
737
- case "InvalidAddress":
738
- case "com.amazonaws.sqs#InvalidAddress":
739
- throw await de_InvalidAddressRes(parsedOutput, context);
740
- case "InvalidSecurity":
741
- case "com.amazonaws.sqs#InvalidSecurity":
742
- throw await de_InvalidSecurityRes(parsedOutput, context);
743
- case "RequestThrottled":
744
- case "com.amazonaws.sqs#RequestThrottled":
745
- throw await de_RequestThrottledRes(parsedOutput, context);
746
- case "ResourceNotFoundException":
747
- case "com.amazonaws.sqs#ResourceNotFoundException":
748
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
749
- case "UnsupportedOperation":
750
- case "com.amazonaws.sqs#UnsupportedOperation":
751
- throw await de_UnsupportedOperationRes(parsedOutput, context);
752
- default:
753
- const parsedBody = parsedOutput.body;
754
- return throwDefaultError({
755
- output,
756
- parsedBody,
757
- errorCode,
758
- });
759
- }
760
- };
761
- const de_ListQueuesCommand = async (output, context) => {
762
- if (output.statusCode >= 300) {
763
- return de_ListQueuesCommandError(output, context);
764
- }
765
- const data = await parseBody(output.body, context);
766
- let contents = {};
767
- contents = (0, smithy_client_1._json)(data);
768
- const response = {
769
- $metadata: deserializeMetadata(output),
770
- ...contents,
771
- };
772
- return response;
773
- };
774
- exports.de_ListQueuesCommand = de_ListQueuesCommand;
775
- const de_ListQueuesCommandError = async (output, context) => {
776
- const parsedOutput = {
777
- ...output,
778
- body: await parseErrorBody(output.body, context),
779
- };
780
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
781
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
782
- switch (errorCode) {
783
- case "InvalidAddress":
784
- case "com.amazonaws.sqs#InvalidAddress":
785
- throw await de_InvalidAddressRes(parsedOutput, context);
786
- case "InvalidSecurity":
787
- case "com.amazonaws.sqs#InvalidSecurity":
788
- throw await de_InvalidSecurityRes(parsedOutput, context);
789
- case "RequestThrottled":
790
- case "com.amazonaws.sqs#RequestThrottled":
791
- throw await de_RequestThrottledRes(parsedOutput, context);
792
- case "UnsupportedOperation":
793
- case "com.amazonaws.sqs#UnsupportedOperation":
794
- throw await de_UnsupportedOperationRes(parsedOutput, context);
795
- default:
796
- const parsedBody = parsedOutput.body;
797
- return throwDefaultError({
798
- output,
799
- parsedBody,
800
- errorCode,
801
- });
802
- }
803
- };
804
- const de_ListQueueTagsCommand = async (output, context) => {
805
- if (output.statusCode >= 300) {
806
- return de_ListQueueTagsCommandError(output, context);
807
- }
808
- const data = await parseBody(output.body, context);
809
- let contents = {};
810
- contents = (0, smithy_client_1._json)(data);
811
- const response = {
812
- $metadata: deserializeMetadata(output),
813
- ...contents,
814
- };
815
- return response;
816
- };
817
- exports.de_ListQueueTagsCommand = de_ListQueueTagsCommand;
818
- const de_ListQueueTagsCommandError = async (output, context) => {
819
- const parsedOutput = {
820
- ...output,
821
- body: await parseErrorBody(output.body, context),
822
- };
823
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
824
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
825
- switch (errorCode) {
826
- case "InvalidAddress":
827
- case "com.amazonaws.sqs#InvalidAddress":
828
- throw await de_InvalidAddressRes(parsedOutput, context);
829
- case "InvalidSecurity":
830
- case "com.amazonaws.sqs#InvalidSecurity":
831
- throw await de_InvalidSecurityRes(parsedOutput, context);
832
- case "QueueDoesNotExist":
833
- case "com.amazonaws.sqs#QueueDoesNotExist":
834
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
835
- case "RequestThrottled":
836
- case "com.amazonaws.sqs#RequestThrottled":
837
- throw await de_RequestThrottledRes(parsedOutput, context);
838
- case "UnsupportedOperation":
839
- case "com.amazonaws.sqs#UnsupportedOperation":
840
- throw await de_UnsupportedOperationRes(parsedOutput, context);
841
- default:
842
- const parsedBody = parsedOutput.body;
843
- return throwDefaultError({
844
- output,
845
- parsedBody,
846
- errorCode,
847
- });
848
- }
849
- };
850
- const de_PurgeQueueCommand = async (output, context) => {
851
- if (output.statusCode >= 300) {
852
- return de_PurgeQueueCommandError(output, context);
853
- }
854
- await (0, smithy_client_1.collectBody)(output.body, context);
855
- const response = {
856
- $metadata: deserializeMetadata(output),
857
- };
858
- return response;
859
- };
860
- exports.de_PurgeQueueCommand = de_PurgeQueueCommand;
861
- const de_PurgeQueueCommandError = async (output, context) => {
862
- const parsedOutput = {
863
- ...output,
864
- body: await parseErrorBody(output.body, context),
865
- };
866
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
867
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
868
- switch (errorCode) {
869
- case "InvalidAddress":
870
- case "com.amazonaws.sqs#InvalidAddress":
871
- throw await de_InvalidAddressRes(parsedOutput, context);
872
- case "InvalidSecurity":
873
- case "com.amazonaws.sqs#InvalidSecurity":
874
- throw await de_InvalidSecurityRes(parsedOutput, context);
875
- case "PurgeQueueInProgress":
876
- case "com.amazonaws.sqs#PurgeQueueInProgress":
877
- throw await de_PurgeQueueInProgressRes(parsedOutput, context);
878
- case "QueueDoesNotExist":
879
- case "com.amazonaws.sqs#QueueDoesNotExist":
880
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
881
- case "RequestThrottled":
882
- case "com.amazonaws.sqs#RequestThrottled":
883
- throw await de_RequestThrottledRes(parsedOutput, context);
884
- case "UnsupportedOperation":
885
- case "com.amazonaws.sqs#UnsupportedOperation":
886
- throw await de_UnsupportedOperationRes(parsedOutput, context);
887
- default:
888
- const parsedBody = parsedOutput.body;
889
- return throwDefaultError({
890
- output,
891
- parsedBody,
892
- errorCode,
893
- });
894
- }
895
- };
896
- const de_ReceiveMessageCommand = async (output, context) => {
897
- if (output.statusCode >= 300) {
898
- return de_ReceiveMessageCommandError(output, context);
899
- }
900
- const data = await parseBody(output.body, context);
901
- let contents = {};
902
- contents = de_ReceiveMessageResult(data, context);
903
- const response = {
904
- $metadata: deserializeMetadata(output),
905
- ...contents,
906
- };
907
- return response;
908
- };
909
- exports.de_ReceiveMessageCommand = de_ReceiveMessageCommand;
910
- const de_ReceiveMessageCommandError = async (output, context) => {
911
- const parsedOutput = {
912
- ...output,
913
- body: await parseErrorBody(output.body, context),
914
- };
915
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
916
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
917
- switch (errorCode) {
918
- case "InvalidAddress":
919
- case "com.amazonaws.sqs#InvalidAddress":
920
- throw await de_InvalidAddressRes(parsedOutput, context);
921
- case "InvalidSecurity":
922
- case "com.amazonaws.sqs#InvalidSecurity":
923
- throw await de_InvalidSecurityRes(parsedOutput, context);
924
- case "KmsAccessDenied":
925
- case "com.amazonaws.sqs#KmsAccessDenied":
926
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
927
- case "KmsDisabled":
928
- case "com.amazonaws.sqs#KmsDisabled":
929
- throw await de_KmsDisabledRes(parsedOutput, context);
930
- case "KmsInvalidKeyUsage":
931
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
932
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
933
- case "KmsInvalidState":
934
- case "com.amazonaws.sqs#KmsInvalidState":
935
- throw await de_KmsInvalidStateRes(parsedOutput, context);
936
- case "KmsNotFound":
937
- case "com.amazonaws.sqs#KmsNotFound":
938
- throw await de_KmsNotFoundRes(parsedOutput, context);
939
- case "KmsOptInRequired":
940
- case "com.amazonaws.sqs#KmsOptInRequired":
941
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
942
- case "KmsThrottled":
943
- case "com.amazonaws.sqs#KmsThrottled":
944
- throw await de_KmsThrottledRes(parsedOutput, context);
945
- case "OverLimit":
946
- case "com.amazonaws.sqs#OverLimit":
947
- throw await de_OverLimitRes(parsedOutput, context);
948
- case "QueueDoesNotExist":
949
- case "com.amazonaws.sqs#QueueDoesNotExist":
950
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
951
- case "RequestThrottled":
952
- case "com.amazonaws.sqs#RequestThrottled":
953
- throw await de_RequestThrottledRes(parsedOutput, context);
954
- case "UnsupportedOperation":
955
- case "com.amazonaws.sqs#UnsupportedOperation":
956
- throw await de_UnsupportedOperationRes(parsedOutput, context);
957
- default:
958
- const parsedBody = parsedOutput.body;
959
- return throwDefaultError({
960
- output,
961
- parsedBody,
962
- errorCode,
963
- });
964
- }
965
- };
966
- const de_RemovePermissionCommand = async (output, context) => {
967
- if (output.statusCode >= 300) {
968
- return de_RemovePermissionCommandError(output, context);
969
- }
970
- await (0, smithy_client_1.collectBody)(output.body, context);
971
- const response = {
972
- $metadata: deserializeMetadata(output),
973
- };
974
- return response;
975
- };
976
- exports.de_RemovePermissionCommand = de_RemovePermissionCommand;
977
- const de_RemovePermissionCommandError = async (output, context) => {
978
- const parsedOutput = {
979
- ...output,
980
- body: await parseErrorBody(output.body, context),
981
- };
982
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
983
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
984
- switch (errorCode) {
985
- case "InvalidAddress":
986
- case "com.amazonaws.sqs#InvalidAddress":
987
- throw await de_InvalidAddressRes(parsedOutput, context);
988
- case "InvalidSecurity":
989
- case "com.amazonaws.sqs#InvalidSecurity":
990
- throw await de_InvalidSecurityRes(parsedOutput, context);
991
- case "QueueDoesNotExist":
992
- case "com.amazonaws.sqs#QueueDoesNotExist":
993
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
994
- case "RequestThrottled":
995
- case "com.amazonaws.sqs#RequestThrottled":
996
- throw await de_RequestThrottledRes(parsedOutput, context);
997
- case "UnsupportedOperation":
998
- case "com.amazonaws.sqs#UnsupportedOperation":
999
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1000
- default:
1001
- const parsedBody = parsedOutput.body;
1002
- return throwDefaultError({
1003
- output,
1004
- parsedBody,
1005
- errorCode,
1006
- });
1007
- }
1008
- };
1009
- const de_SendMessageCommand = async (output, context) => {
1010
- if (output.statusCode >= 300) {
1011
- return de_SendMessageCommandError(output, context);
1012
- }
1013
- const data = await parseBody(output.body, context);
1014
- let contents = {};
1015
- contents = (0, smithy_client_1._json)(data);
1016
- const response = {
1017
- $metadata: deserializeMetadata(output),
1018
- ...contents,
1019
- };
1020
- return response;
1021
- };
1022
- exports.de_SendMessageCommand = de_SendMessageCommand;
1023
- const de_SendMessageCommandError = async (output, context) => {
1024
- const parsedOutput = {
1025
- ...output,
1026
- body: await parseErrorBody(output.body, context),
1027
- };
1028
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1029
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1030
- switch (errorCode) {
1031
- case "InvalidAddress":
1032
- case "com.amazonaws.sqs#InvalidAddress":
1033
- throw await de_InvalidAddressRes(parsedOutput, context);
1034
- case "InvalidMessageContents":
1035
- case "com.amazonaws.sqs#InvalidMessageContents":
1036
- throw await de_InvalidMessageContentsRes(parsedOutput, context);
1037
- case "InvalidSecurity":
1038
- case "com.amazonaws.sqs#InvalidSecurity":
1039
- throw await de_InvalidSecurityRes(parsedOutput, context);
1040
- case "KmsAccessDenied":
1041
- case "com.amazonaws.sqs#KmsAccessDenied":
1042
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
1043
- case "KmsDisabled":
1044
- case "com.amazonaws.sqs#KmsDisabled":
1045
- throw await de_KmsDisabledRes(parsedOutput, context);
1046
- case "KmsInvalidKeyUsage":
1047
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
1048
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
1049
- case "KmsInvalidState":
1050
- case "com.amazonaws.sqs#KmsInvalidState":
1051
- throw await de_KmsInvalidStateRes(parsedOutput, context);
1052
- case "KmsNotFound":
1053
- case "com.amazonaws.sqs#KmsNotFound":
1054
- throw await de_KmsNotFoundRes(parsedOutput, context);
1055
- case "KmsOptInRequired":
1056
- case "com.amazonaws.sqs#KmsOptInRequired":
1057
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
1058
- case "KmsThrottled":
1059
- case "com.amazonaws.sqs#KmsThrottled":
1060
- throw await de_KmsThrottledRes(parsedOutput, context);
1061
- case "QueueDoesNotExist":
1062
- case "com.amazonaws.sqs#QueueDoesNotExist":
1063
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1064
- case "RequestThrottled":
1065
- case "com.amazonaws.sqs#RequestThrottled":
1066
- throw await de_RequestThrottledRes(parsedOutput, context);
1067
- case "UnsupportedOperation":
1068
- case "com.amazonaws.sqs#UnsupportedOperation":
1069
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1070
- default:
1071
- const parsedBody = parsedOutput.body;
1072
- return throwDefaultError({
1073
- output,
1074
- parsedBody,
1075
- errorCode,
1076
- });
1077
- }
1078
- };
1079
- const de_SendMessageBatchCommand = async (output, context) => {
1080
- if (output.statusCode >= 300) {
1081
- return de_SendMessageBatchCommandError(output, context);
1082
- }
1083
- const data = await parseBody(output.body, context);
1084
- let contents = {};
1085
- contents = (0, smithy_client_1._json)(data);
1086
- const response = {
1087
- $metadata: deserializeMetadata(output),
1088
- ...contents,
1089
- };
1090
- return response;
1091
- };
1092
- exports.de_SendMessageBatchCommand = de_SendMessageBatchCommand;
1093
- const de_SendMessageBatchCommandError = async (output, context) => {
1094
- const parsedOutput = {
1095
- ...output,
1096
- body: await parseErrorBody(output.body, context),
1097
- };
1098
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1099
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1100
- switch (errorCode) {
1101
- case "BatchEntryIdsNotDistinct":
1102
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
1103
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
1104
- case "BatchRequestTooLong":
1105
- case "com.amazonaws.sqs#BatchRequestTooLong":
1106
- throw await de_BatchRequestTooLongRes(parsedOutput, context);
1107
- case "EmptyBatchRequest":
1108
- case "com.amazonaws.sqs#EmptyBatchRequest":
1109
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
1110
- case "InvalidAddress":
1111
- case "com.amazonaws.sqs#InvalidAddress":
1112
- throw await de_InvalidAddressRes(parsedOutput, context);
1113
- case "InvalidBatchEntryId":
1114
- case "com.amazonaws.sqs#InvalidBatchEntryId":
1115
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
1116
- case "InvalidSecurity":
1117
- case "com.amazonaws.sqs#InvalidSecurity":
1118
- throw await de_InvalidSecurityRes(parsedOutput, context);
1119
- case "KmsAccessDenied":
1120
- case "com.amazonaws.sqs#KmsAccessDenied":
1121
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
1122
- case "KmsDisabled":
1123
- case "com.amazonaws.sqs#KmsDisabled":
1124
- throw await de_KmsDisabledRes(parsedOutput, context);
1125
- case "KmsInvalidKeyUsage":
1126
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
1127
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
1128
- case "KmsInvalidState":
1129
- case "com.amazonaws.sqs#KmsInvalidState":
1130
- throw await de_KmsInvalidStateRes(parsedOutput, context);
1131
- case "KmsNotFound":
1132
- case "com.amazonaws.sqs#KmsNotFound":
1133
- throw await de_KmsNotFoundRes(parsedOutput, context);
1134
- case "KmsOptInRequired":
1135
- case "com.amazonaws.sqs#KmsOptInRequired":
1136
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
1137
- case "KmsThrottled":
1138
- case "com.amazonaws.sqs#KmsThrottled":
1139
- throw await de_KmsThrottledRes(parsedOutput, context);
1140
- case "QueueDoesNotExist":
1141
- case "com.amazonaws.sqs#QueueDoesNotExist":
1142
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1143
- case "RequestThrottled":
1144
- case "com.amazonaws.sqs#RequestThrottled":
1145
- throw await de_RequestThrottledRes(parsedOutput, context);
1146
- case "TooManyEntriesInBatchRequest":
1147
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
1148
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
1149
- case "UnsupportedOperation":
1150
- case "com.amazonaws.sqs#UnsupportedOperation":
1151
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1152
- default:
1153
- const parsedBody = parsedOutput.body;
1154
- return throwDefaultError({
1155
- output,
1156
- parsedBody,
1157
- errorCode,
1158
- });
1159
- }
1160
- };
1161
- const de_SetQueueAttributesCommand = async (output, context) => {
1162
- if (output.statusCode >= 300) {
1163
- return de_SetQueueAttributesCommandError(output, context);
1164
- }
1165
- await (0, smithy_client_1.collectBody)(output.body, context);
1166
- const response = {
1167
- $metadata: deserializeMetadata(output),
1168
- };
1169
- return response;
1170
- };
1171
- exports.de_SetQueueAttributesCommand = de_SetQueueAttributesCommand;
1172
- const de_SetQueueAttributesCommandError = async (output, context) => {
1173
- const parsedOutput = {
1174
- ...output,
1175
- body: await parseErrorBody(output.body, context),
1176
- };
1177
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1178
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
- switch (errorCode) {
1180
- case "InvalidAddress":
1181
- case "com.amazonaws.sqs#InvalidAddress":
1182
- throw await de_InvalidAddressRes(parsedOutput, context);
1183
- case "InvalidAttributeName":
1184
- case "com.amazonaws.sqs#InvalidAttributeName":
1185
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
1186
- case "InvalidAttributeValue":
1187
- case "com.amazonaws.sqs#InvalidAttributeValue":
1188
- throw await de_InvalidAttributeValueRes(parsedOutput, context);
1189
- case "InvalidSecurity":
1190
- case "com.amazonaws.sqs#InvalidSecurity":
1191
- throw await de_InvalidSecurityRes(parsedOutput, context);
1192
- case "OverLimit":
1193
- case "com.amazonaws.sqs#OverLimit":
1194
- throw await de_OverLimitRes(parsedOutput, context);
1195
- case "QueueDoesNotExist":
1196
- case "com.amazonaws.sqs#QueueDoesNotExist":
1197
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1198
- case "RequestThrottled":
1199
- case "com.amazonaws.sqs#RequestThrottled":
1200
- throw await de_RequestThrottledRes(parsedOutput, context);
1201
- case "UnsupportedOperation":
1202
- case "com.amazonaws.sqs#UnsupportedOperation":
1203
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1204
- default:
1205
- const parsedBody = parsedOutput.body;
1206
- return throwDefaultError({
1207
- output,
1208
- parsedBody,
1209
- errorCode,
1210
- });
1211
- }
1212
- };
1213
- const de_StartMessageMoveTaskCommand = async (output, context) => {
1214
- if (output.statusCode >= 300) {
1215
- return de_StartMessageMoveTaskCommandError(output, context);
1216
- }
1217
- const data = await parseBody(output.body, context);
1218
- let contents = {};
1219
- contents = (0, smithy_client_1._json)(data);
1220
- const response = {
1221
- $metadata: deserializeMetadata(output),
1222
- ...contents,
1223
- };
1224
- return response;
1225
- };
1226
- exports.de_StartMessageMoveTaskCommand = de_StartMessageMoveTaskCommand;
1227
- const de_StartMessageMoveTaskCommandError = async (output, context) => {
1228
- const parsedOutput = {
1229
- ...output,
1230
- body: await parseErrorBody(output.body, context),
1231
- };
1232
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1233
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1234
- switch (errorCode) {
1235
- case "InvalidAddress":
1236
- case "com.amazonaws.sqs#InvalidAddress":
1237
- throw await de_InvalidAddressRes(parsedOutput, context);
1238
- case "InvalidSecurity":
1239
- case "com.amazonaws.sqs#InvalidSecurity":
1240
- throw await de_InvalidSecurityRes(parsedOutput, context);
1241
- case "RequestThrottled":
1242
- case "com.amazonaws.sqs#RequestThrottled":
1243
- throw await de_RequestThrottledRes(parsedOutput, context);
1244
- case "ResourceNotFoundException":
1245
- case "com.amazonaws.sqs#ResourceNotFoundException":
1246
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1247
- case "UnsupportedOperation":
1248
- case "com.amazonaws.sqs#UnsupportedOperation":
1249
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1250
- default:
1251
- const parsedBody = parsedOutput.body;
1252
- return throwDefaultError({
1253
- output,
1254
- parsedBody,
1255
- errorCode,
1256
- });
1257
- }
1258
- };
1259
- const de_TagQueueCommand = async (output, context) => {
1260
- if (output.statusCode >= 300) {
1261
- return de_TagQueueCommandError(output, context);
1262
- }
1263
- await (0, smithy_client_1.collectBody)(output.body, context);
1264
- const response = {
1265
- $metadata: deserializeMetadata(output),
1266
- };
1267
- return response;
1268
- };
1269
- exports.de_TagQueueCommand = de_TagQueueCommand;
1270
- const de_TagQueueCommandError = async (output, context) => {
1271
- const parsedOutput = {
1272
- ...output,
1273
- body: await parseErrorBody(output.body, context),
1274
- };
1275
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1276
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1277
- switch (errorCode) {
1278
- case "InvalidAddress":
1279
- case "com.amazonaws.sqs#InvalidAddress":
1280
- throw await de_InvalidAddressRes(parsedOutput, context);
1281
- case "InvalidSecurity":
1282
- case "com.amazonaws.sqs#InvalidSecurity":
1283
- throw await de_InvalidSecurityRes(parsedOutput, context);
1284
- case "QueueDoesNotExist":
1285
- case "com.amazonaws.sqs#QueueDoesNotExist":
1286
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1287
- case "RequestThrottled":
1288
- case "com.amazonaws.sqs#RequestThrottled":
1289
- throw await de_RequestThrottledRes(parsedOutput, context);
1290
- case "UnsupportedOperation":
1291
- case "com.amazonaws.sqs#UnsupportedOperation":
1292
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1293
- default:
1294
- const parsedBody = parsedOutput.body;
1295
- return throwDefaultError({
1296
- output,
1297
- parsedBody,
1298
- errorCode,
1299
- });
1300
- }
1301
- };
1302
- const de_UntagQueueCommand = async (output, context) => {
1303
- if (output.statusCode >= 300) {
1304
- return de_UntagQueueCommandError(output, context);
1305
- }
1306
- await (0, smithy_client_1.collectBody)(output.body, context);
1307
- const response = {
1308
- $metadata: deserializeMetadata(output),
1309
- };
1310
- return response;
1311
- };
1312
- exports.de_UntagQueueCommand = de_UntagQueueCommand;
1313
- const de_UntagQueueCommandError = async (output, context) => {
1314
- const parsedOutput = {
1315
- ...output,
1316
- body: await parseErrorBody(output.body, context),
1317
- };
1318
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1319
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1320
- switch (errorCode) {
1321
- case "InvalidAddress":
1322
- case "com.amazonaws.sqs#InvalidAddress":
1323
- throw await de_InvalidAddressRes(parsedOutput, context);
1324
- case "InvalidSecurity":
1325
- case "com.amazonaws.sqs#InvalidSecurity":
1326
- throw await de_InvalidSecurityRes(parsedOutput, context);
1327
- case "QueueDoesNotExist":
1328
- case "com.amazonaws.sqs#QueueDoesNotExist":
1329
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1330
- case "RequestThrottled":
1331
- case "com.amazonaws.sqs#RequestThrottled":
1332
- throw await de_RequestThrottledRes(parsedOutput, context);
1333
- case "UnsupportedOperation":
1334
- case "com.amazonaws.sqs#UnsupportedOperation":
1335
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1336
- default:
1337
- const parsedBody = parsedOutput.body;
1338
- return throwDefaultError({
1339
- output,
1340
- parsedBody,
1341
- errorCode,
1342
- });
1343
- }
1344
- };
1345
- const de_BatchEntryIdsNotDistinctRes = async (parsedOutput, context) => {
1346
- const body = parsedOutput.body;
1347
- const deserialized = (0, smithy_client_1._json)(body);
1348
- const exception = new models_0_1.BatchEntryIdsNotDistinct({
1349
- $metadata: deserializeMetadata(parsedOutput),
1350
- ...deserialized,
1351
- });
1352
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1353
- };
1354
- const de_BatchRequestTooLongRes = async (parsedOutput, context) => {
1355
- const body = parsedOutput.body;
1356
- const deserialized = (0, smithy_client_1._json)(body);
1357
- const exception = new models_0_1.BatchRequestTooLong({
1358
- $metadata: deserializeMetadata(parsedOutput),
1359
- ...deserialized,
1360
- });
1361
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1362
- };
1363
- const de_EmptyBatchRequestRes = async (parsedOutput, context) => {
1364
- const body = parsedOutput.body;
1365
- const deserialized = (0, smithy_client_1._json)(body);
1366
- const exception = new models_0_1.EmptyBatchRequest({
1367
- $metadata: deserializeMetadata(parsedOutput),
1368
- ...deserialized,
1369
- });
1370
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1371
- };
1372
- const de_InvalidAddressRes = async (parsedOutput, context) => {
1373
- const body = parsedOutput.body;
1374
- const deserialized = (0, smithy_client_1._json)(body);
1375
- const exception = new models_0_1.InvalidAddress({
1376
- $metadata: deserializeMetadata(parsedOutput),
1377
- ...deserialized,
1378
- });
1379
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1380
- };
1381
- const de_InvalidAttributeNameRes = async (parsedOutput, context) => {
1382
- const body = parsedOutput.body;
1383
- const deserialized = (0, smithy_client_1._json)(body);
1384
- const exception = new models_0_1.InvalidAttributeName({
1385
- $metadata: deserializeMetadata(parsedOutput),
1386
- ...deserialized,
1387
- });
1388
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1389
- };
1390
- const de_InvalidAttributeValueRes = async (parsedOutput, context) => {
1391
- const body = parsedOutput.body;
1392
- const deserialized = (0, smithy_client_1._json)(body);
1393
- const exception = new models_0_1.InvalidAttributeValue({
1394
- $metadata: deserializeMetadata(parsedOutput),
1395
- ...deserialized,
1396
- });
1397
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1398
- };
1399
- const de_InvalidBatchEntryIdRes = async (parsedOutput, context) => {
1400
- const body = parsedOutput.body;
1401
- const deserialized = (0, smithy_client_1._json)(body);
1402
- const exception = new models_0_1.InvalidBatchEntryId({
1403
- $metadata: deserializeMetadata(parsedOutput),
1404
- ...deserialized,
1405
- });
1406
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1407
- };
1408
- const de_InvalidIdFormatRes = async (parsedOutput, context) => {
1409
- const body = parsedOutput.body;
1410
- const deserialized = (0, smithy_client_1._json)(body);
1411
- const exception = new models_0_1.InvalidIdFormat({
1412
- $metadata: deserializeMetadata(parsedOutput),
1413
- ...deserialized,
1414
- });
1415
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1416
- };
1417
- const de_InvalidMessageContentsRes = async (parsedOutput, context) => {
1418
- const body = parsedOutput.body;
1419
- const deserialized = (0, smithy_client_1._json)(body);
1420
- const exception = new models_0_1.InvalidMessageContents({
1421
- $metadata: deserializeMetadata(parsedOutput),
1422
- ...deserialized,
1423
- });
1424
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1425
- };
1426
- const de_InvalidSecurityRes = async (parsedOutput, context) => {
1427
- const body = parsedOutput.body;
1428
- const deserialized = (0, smithy_client_1._json)(body);
1429
- const exception = new models_0_1.InvalidSecurity({
1430
- $metadata: deserializeMetadata(parsedOutput),
1431
- ...deserialized,
1432
- });
1433
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1434
- };
1435
- const de_KmsAccessDeniedRes = async (parsedOutput, context) => {
1436
- const body = parsedOutput.body;
1437
- const deserialized = (0, smithy_client_1._json)(body);
1438
- const exception = new models_0_1.KmsAccessDenied({
1439
- $metadata: deserializeMetadata(parsedOutput),
1440
- ...deserialized,
1441
- });
1442
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1443
- };
1444
- const de_KmsDisabledRes = async (parsedOutput, context) => {
1445
- const body = parsedOutput.body;
1446
- const deserialized = (0, smithy_client_1._json)(body);
1447
- const exception = new models_0_1.KmsDisabled({
1448
- $metadata: deserializeMetadata(parsedOutput),
1449
- ...deserialized,
1450
- });
1451
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1452
- };
1453
- const de_KmsInvalidKeyUsageRes = async (parsedOutput, context) => {
1454
- const body = parsedOutput.body;
1455
- const deserialized = (0, smithy_client_1._json)(body);
1456
- const exception = new models_0_1.KmsInvalidKeyUsage({
1457
- $metadata: deserializeMetadata(parsedOutput),
1458
- ...deserialized,
1459
- });
1460
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1461
- };
1462
- const de_KmsInvalidStateRes = async (parsedOutput, context) => {
1463
- const body = parsedOutput.body;
1464
- const deserialized = (0, smithy_client_1._json)(body);
1465
- const exception = new models_0_1.KmsInvalidState({
1466
- $metadata: deserializeMetadata(parsedOutput),
1467
- ...deserialized,
1468
- });
1469
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1470
- };
1471
- const de_KmsNotFoundRes = async (parsedOutput, context) => {
1472
- const body = parsedOutput.body;
1473
- const deserialized = (0, smithy_client_1._json)(body);
1474
- const exception = new models_0_1.KmsNotFound({
1475
- $metadata: deserializeMetadata(parsedOutput),
1476
- ...deserialized,
1477
- });
1478
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1479
- };
1480
- const de_KmsOptInRequiredRes = async (parsedOutput, context) => {
1481
- const body = parsedOutput.body;
1482
- const deserialized = (0, smithy_client_1._json)(body);
1483
- const exception = new models_0_1.KmsOptInRequired({
1484
- $metadata: deserializeMetadata(parsedOutput),
1485
- ...deserialized,
1486
- });
1487
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1488
- };
1489
- const de_KmsThrottledRes = async (parsedOutput, context) => {
1490
- const body = parsedOutput.body;
1491
- const deserialized = (0, smithy_client_1._json)(body);
1492
- const exception = new models_0_1.KmsThrottled({
1493
- $metadata: deserializeMetadata(parsedOutput),
1494
- ...deserialized,
1495
- });
1496
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1497
- };
1498
- const de_MessageNotInflightRes = async (parsedOutput, context) => {
1499
- const body = parsedOutput.body;
1500
- const deserialized = (0, smithy_client_1._json)(body);
1501
- const exception = new models_0_1.MessageNotInflight({
1502
- $metadata: deserializeMetadata(parsedOutput),
1503
- ...deserialized,
1504
- });
1505
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1506
- };
1507
- const de_OverLimitRes = async (parsedOutput, context) => {
1508
- const body = parsedOutput.body;
1509
- const deserialized = (0, smithy_client_1._json)(body);
1510
- const exception = new models_0_1.OverLimit({
1511
- $metadata: deserializeMetadata(parsedOutput),
1512
- ...deserialized,
1513
- });
1514
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1515
- };
1516
- const de_PurgeQueueInProgressRes = async (parsedOutput, context) => {
1517
- const body = parsedOutput.body;
1518
- const deserialized = (0, smithy_client_1._json)(body);
1519
- const exception = new models_0_1.PurgeQueueInProgress({
1520
- $metadata: deserializeMetadata(parsedOutput),
1521
- ...deserialized,
1522
- });
1523
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1524
- };
1525
- const de_QueueDeletedRecentlyRes = async (parsedOutput, context) => {
1526
- const body = parsedOutput.body;
1527
- const deserialized = (0, smithy_client_1._json)(body);
1528
- const exception = new models_0_1.QueueDeletedRecently({
1529
- $metadata: deserializeMetadata(parsedOutput),
1530
- ...deserialized,
1531
- });
1532
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1533
- };
1534
- const de_QueueDoesNotExistRes = async (parsedOutput, context) => {
1535
- const body = parsedOutput.body;
1536
- const deserialized = (0, smithy_client_1._json)(body);
1537
- const exception = new models_0_1.QueueDoesNotExist({
1538
- $metadata: deserializeMetadata(parsedOutput),
1539
- ...deserialized,
1540
- });
1541
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1542
- };
1543
- const de_QueueNameExistsRes = async (parsedOutput, context) => {
1544
- const body = parsedOutput.body;
1545
- const deserialized = (0, smithy_client_1._json)(body);
1546
- const exception = new models_0_1.QueueNameExists({
1547
- $metadata: deserializeMetadata(parsedOutput),
1548
- ...deserialized,
1549
- });
1550
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1551
- };
1552
- const de_ReceiptHandleIsInvalidRes = async (parsedOutput, context) => {
1553
- const body = parsedOutput.body;
1554
- const deserialized = (0, smithy_client_1._json)(body);
1555
- const exception = new models_0_1.ReceiptHandleIsInvalid({
1556
- $metadata: deserializeMetadata(parsedOutput),
1557
- ...deserialized,
1558
- });
1559
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1560
- };
1561
- const de_RequestThrottledRes = async (parsedOutput, context) => {
1562
- const body = parsedOutput.body;
1563
- const deserialized = (0, smithy_client_1._json)(body);
1564
- const exception = new models_0_1.RequestThrottled({
1565
- $metadata: deserializeMetadata(parsedOutput),
1566
- ...deserialized,
1567
- });
1568
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1569
- };
1570
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1571
- const body = parsedOutput.body;
1572
- const deserialized = (0, smithy_client_1._json)(body);
1573
- const exception = new models_0_1.ResourceNotFoundException({
1574
- $metadata: deserializeMetadata(parsedOutput),
1575
- ...deserialized,
1576
- });
1577
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1578
- };
1579
- const de_TooManyEntriesInBatchRequestRes = async (parsedOutput, context) => {
1580
- const body = parsedOutput.body;
1581
- const deserialized = (0, smithy_client_1._json)(body);
1582
- const exception = new models_0_1.TooManyEntriesInBatchRequest({
1583
- $metadata: deserializeMetadata(parsedOutput),
1584
- ...deserialized,
1585
- });
1586
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1587
- };
1588
- const de_UnsupportedOperationRes = async (parsedOutput, context) => {
1589
- const body = parsedOutput.body;
1590
- const deserialized = (0, smithy_client_1._json)(body);
1591
- const exception = new models_0_1.UnsupportedOperation({
1592
- $metadata: deserializeMetadata(parsedOutput),
1593
- ...deserialized,
1594
- });
1595
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1596
- };
1597
- const se_ActionNameList = (input, context) => {
1598
- return input
1599
- .filter((e) => e != null)
1600
- .map((entry) => {
1601
- return (0, core_1._toStr)(entry);
1602
- });
1603
- };
1604
- const se_AddPermissionRequest = (input, context) => {
1605
- return (0, smithy_client_1.take)(input, {
1606
- AWSAccountIds: (_) => se_AWSAccountIdList(_, context),
1607
- Actions: (_) => se_ActionNameList(_, context),
1608
- Label: core_1._toStr,
1609
- QueueUrl: core_1._toStr,
1610
- });
1611
- };
1612
- const se_AttributeNameList = (input, context) => {
1613
- return input
1614
- .filter((e) => e != null)
1615
- .map((entry) => {
1616
- return (0, core_1._toStr)(entry);
1617
- });
1618
- };
1619
- const se_AWSAccountIdList = (input, context) => {
1620
- return input
1621
- .filter((e) => e != null)
1622
- .map((entry) => {
1623
- return (0, core_1._toStr)(entry);
1624
- });
1625
- };
1626
- const se_BinaryList = (input, context) => {
1627
- return input
1628
- .filter((e) => e != null)
1629
- .map((entry) => {
1630
- return context.base64Encoder(entry);
1631
- });
1632
- };
1633
- const se_CancelMessageMoveTaskRequest = (input, context) => {
1634
- return (0, smithy_client_1.take)(input, {
1635
- TaskHandle: core_1._toStr,
1636
- });
1637
- };
1638
- const se_ChangeMessageVisibilityBatchRequest = (input, context) => {
1639
- return (0, smithy_client_1.take)(input, {
1640
- Entries: (_) => se_ChangeMessageVisibilityBatchRequestEntryList(_, context),
1641
- QueueUrl: core_1._toStr,
1642
- });
1643
- };
1644
- const se_ChangeMessageVisibilityBatchRequestEntry = (input, context) => {
1645
- return (0, smithy_client_1.take)(input, {
1646
- Id: core_1._toStr,
1647
- ReceiptHandle: core_1._toStr,
1648
- VisibilityTimeout: core_1._toNum,
1649
- });
1650
- };
1651
- const se_ChangeMessageVisibilityBatchRequestEntryList = (input, context) => {
1652
- return input
1653
- .filter((e) => e != null)
1654
- .map((entry) => {
1655
- return se_ChangeMessageVisibilityBatchRequestEntry(entry, context);
1656
- });
1657
- };
1658
- const se_ChangeMessageVisibilityRequest = (input, context) => {
1659
- return (0, smithy_client_1.take)(input, {
1660
- QueueUrl: core_1._toStr,
1661
- ReceiptHandle: core_1._toStr,
1662
- VisibilityTimeout: core_1._toNum,
1663
- });
1664
- };
1665
- const se_CreateQueueRequest = (input, context) => {
1666
- return (0, smithy_client_1.take)(input, {
1667
- Attributes: (_) => se_QueueAttributeMap(_, context),
1668
- QueueName: core_1._toStr,
1669
- tags: (_) => se_TagMap(_, context),
1670
- });
1671
- };
1672
- const se_DeleteMessageBatchRequest = (input, context) => {
1673
- return (0, smithy_client_1.take)(input, {
1674
- Entries: (_) => se_DeleteMessageBatchRequestEntryList(_, context),
1675
- QueueUrl: core_1._toStr,
1676
- });
1677
- };
1678
- const se_DeleteMessageBatchRequestEntry = (input, context) => {
1679
- return (0, smithy_client_1.take)(input, {
1680
- Id: core_1._toStr,
1681
- ReceiptHandle: core_1._toStr,
1682
- });
1683
- };
1684
- const se_DeleteMessageBatchRequestEntryList = (input, context) => {
1685
- return input
1686
- .filter((e) => e != null)
1687
- .map((entry) => {
1688
- return se_DeleteMessageBatchRequestEntry(entry, context);
1689
- });
1690
- };
1691
- const se_DeleteMessageRequest = (input, context) => {
1692
- return (0, smithy_client_1.take)(input, {
1693
- QueueUrl: core_1._toStr,
1694
- ReceiptHandle: core_1._toStr,
1695
- });
1696
- };
1697
- const se_DeleteQueueRequest = (input, context) => {
1698
- return (0, smithy_client_1.take)(input, {
1699
- QueueUrl: core_1._toStr,
1700
- });
1701
- };
1702
- const se_GetQueueAttributesRequest = (input, context) => {
1703
- return (0, smithy_client_1.take)(input, {
1704
- AttributeNames: (_) => se_AttributeNameList(_, context),
1705
- QueueUrl: core_1._toStr,
1706
- });
1707
- };
1708
- const se_GetQueueUrlRequest = (input, context) => {
1709
- return (0, smithy_client_1.take)(input, {
1710
- QueueName: core_1._toStr,
1711
- QueueOwnerAWSAccountId: core_1._toStr,
1712
- });
1713
- };
1714
- const se_ListDeadLetterSourceQueuesRequest = (input, context) => {
1715
- return (0, smithy_client_1.take)(input, {
1716
- MaxResults: core_1._toNum,
1717
- NextToken: core_1._toStr,
1718
- QueueUrl: core_1._toStr,
1719
- });
1720
- };
1721
- const se_ListMessageMoveTasksRequest = (input, context) => {
1722
- return (0, smithy_client_1.take)(input, {
1723
- MaxResults: core_1._toNum,
1724
- SourceArn: core_1._toStr,
1725
- });
1726
- };
1727
- const se_ListQueuesRequest = (input, context) => {
1728
- return (0, smithy_client_1.take)(input, {
1729
- MaxResults: core_1._toNum,
1730
- NextToken: core_1._toStr,
1731
- QueueNamePrefix: core_1._toStr,
1732
- });
1733
- };
1734
- const se_ListQueueTagsRequest = (input, context) => {
1735
- return (0, smithy_client_1.take)(input, {
1736
- QueueUrl: core_1._toStr,
1737
- });
1738
- };
1739
- const se_MessageAttributeNameList = (input, context) => {
1740
- return input
1741
- .filter((e) => e != null)
1742
- .map((entry) => {
1743
- return (0, core_1._toStr)(entry);
1744
- });
1745
- };
1746
- const se_MessageAttributeValue = (input, context) => {
1747
- return (0, smithy_client_1.take)(input, {
1748
- BinaryListValues: (_) => se_BinaryList(_, context),
1749
- BinaryValue: context.base64Encoder,
1750
- DataType: core_1._toStr,
1751
- StringListValues: (_) => se_StringList(_, context),
1752
- StringValue: core_1._toStr,
1753
- });
1754
- };
1755
- const se_MessageBodyAttributeMap = (input, context) => {
1756
- return Object.entries(input).reduce((acc, [key, value]) => {
1757
- if (value === null) {
1758
- return acc;
1759
- }
1760
- acc[key] = se_MessageAttributeValue(value, context);
1761
- return acc;
1762
- }, {});
1763
- };
1764
- const se_MessageBodySystemAttributeMap = (input, context) => {
1765
- return Object.entries(input).reduce((acc, [key, value]) => {
1766
- if (value === null) {
1767
- return acc;
1768
- }
1769
- acc[key] = se_MessageSystemAttributeValue(value, context);
1770
- return acc;
1771
- }, {});
1772
- };
1773
- const se_MessageSystemAttributeValue = (input, context) => {
1774
- return (0, smithy_client_1.take)(input, {
1775
- BinaryListValues: (_) => se_BinaryList(_, context),
1776
- BinaryValue: context.base64Encoder,
1777
- DataType: core_1._toStr,
1778
- StringListValues: (_) => se_StringList(_, context),
1779
- StringValue: core_1._toStr,
1780
- });
1781
- };
1782
- const se_PurgeQueueRequest = (input, context) => {
1783
- return (0, smithy_client_1.take)(input, {
1784
- QueueUrl: core_1._toStr,
1785
- });
1786
- };
1787
- const se_QueueAttributeMap = (input, context) => {
1788
- return Object.entries(input).reduce((acc, [key, value]) => {
1789
- if (value === null) {
1790
- return acc;
1791
- }
1792
- acc[key] = (0, core_1._toStr)(value);
1793
- return acc;
1794
- }, {});
1795
- };
1796
- const se_ReceiveMessageRequest = (input, context) => {
1797
- return (0, smithy_client_1.take)(input, {
1798
- AttributeNames: (_) => se_AttributeNameList(_, context),
1799
- MaxNumberOfMessages: core_1._toNum,
1800
- MessageAttributeNames: (_) => se_MessageAttributeNameList(_, context),
1801
- QueueUrl: core_1._toStr,
1802
- ReceiveRequestAttemptId: core_1._toStr,
1803
- VisibilityTimeout: core_1._toNum,
1804
- WaitTimeSeconds: core_1._toNum,
1805
- });
1806
- };
1807
- const se_RemovePermissionRequest = (input, context) => {
1808
- return (0, smithy_client_1.take)(input, {
1809
- Label: core_1._toStr,
1810
- QueueUrl: core_1._toStr,
1811
- });
1812
- };
1813
- const se_SendMessageBatchRequest = (input, context) => {
1814
- return (0, smithy_client_1.take)(input, {
1815
- Entries: (_) => se_SendMessageBatchRequestEntryList(_, context),
1816
- QueueUrl: core_1._toStr,
1817
- });
1818
- };
1819
- const se_SendMessageBatchRequestEntry = (input, context) => {
1820
- return (0, smithy_client_1.take)(input, {
1821
- DelaySeconds: core_1._toNum,
1822
- Id: core_1._toStr,
1823
- MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1824
- MessageBody: core_1._toStr,
1825
- MessageDeduplicationId: core_1._toStr,
1826
- MessageGroupId: core_1._toStr,
1827
- MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context),
1828
- });
1829
- };
1830
- const se_SendMessageBatchRequestEntryList = (input, context) => {
1831
- return input
1832
- .filter((e) => e != null)
1833
- .map((entry) => {
1834
- return se_SendMessageBatchRequestEntry(entry, context);
1835
- });
1836
- };
1837
- const se_SendMessageRequest = (input, context) => {
1838
- return (0, smithy_client_1.take)(input, {
1839
- DelaySeconds: core_1._toNum,
1840
- MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1841
- MessageBody: core_1._toStr,
1842
- MessageDeduplicationId: core_1._toStr,
1843
- MessageGroupId: core_1._toStr,
1844
- MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context),
1845
- QueueUrl: core_1._toStr,
1846
- });
1847
- };
1848
- const se_SetQueueAttributesRequest = (input, context) => {
1849
- return (0, smithy_client_1.take)(input, {
1850
- Attributes: (_) => se_QueueAttributeMap(_, context),
1851
- QueueUrl: core_1._toStr,
1852
- });
1853
- };
1854
- const se_StartMessageMoveTaskRequest = (input, context) => {
1855
- return (0, smithy_client_1.take)(input, {
1856
- DestinationArn: core_1._toStr,
1857
- MaxNumberOfMessagesPerSecond: core_1._toNum,
1858
- SourceArn: core_1._toStr,
1859
- });
1860
- };
1861
- const se_StringList = (input, context) => {
1862
- return input
1863
- .filter((e) => e != null)
1864
- .map((entry) => {
1865
- return (0, core_1._toStr)(entry);
1866
- });
1867
- };
1868
- const se_TagKeyList = (input, context) => {
1869
- return input
1870
- .filter((e) => e != null)
1871
- .map((entry) => {
1872
- return (0, core_1._toStr)(entry);
1873
- });
1874
- };
1875
- const se_TagMap = (input, context) => {
1876
- return Object.entries(input).reduce((acc, [key, value]) => {
1877
- if (value === null) {
1878
- return acc;
1879
- }
1880
- acc[key] = (0, core_1._toStr)(value);
1881
- return acc;
1882
- }, {});
1883
- };
1884
- const se_TagQueueRequest = (input, context) => {
1885
- return (0, smithy_client_1.take)(input, {
1886
- QueueUrl: core_1._toStr,
1887
- Tags: (_) => se_TagMap(_, context),
1888
- });
1889
- };
1890
- const se_UntagQueueRequest = (input, context) => {
1891
- return (0, smithy_client_1.take)(input, {
1892
- QueueUrl: core_1._toStr,
1893
- TagKeys: (_) => se_TagKeyList(_, context),
1894
- });
1895
- };
1896
- const de_BinaryList = (output, context) => {
1897
- const retVal = (output || [])
1898
- .filter((e) => e != null)
1899
- .map((entry) => {
1900
- return context.base64Decoder(entry);
1901
- });
1902
- return retVal;
1903
- };
1904
- const de_Message = (output, context) => {
1905
- return (0, smithy_client_1.take)(output, {
1906
- Attributes: smithy_client_1._json,
1907
- Body: smithy_client_1.expectString,
1908
- MD5OfBody: smithy_client_1.expectString,
1909
- MD5OfMessageAttributes: smithy_client_1.expectString,
1910
- MessageAttributes: (_) => de_MessageBodyAttributeMap(_, context),
1911
- MessageId: smithy_client_1.expectString,
1912
- ReceiptHandle: smithy_client_1.expectString,
1913
- });
1914
- };
1915
- const de_MessageAttributeValue = (output, context) => {
1916
- return (0, smithy_client_1.take)(output, {
1917
- BinaryListValues: (_) => de_BinaryList(_, context),
1918
- BinaryValue: context.base64Decoder,
1919
- DataType: smithy_client_1.expectString,
1920
- StringListValues: smithy_client_1._json,
1921
- StringValue: smithy_client_1.expectString,
1922
- });
1923
- };
1924
- const de_MessageBodyAttributeMap = (output, context) => {
1925
- return Object.entries(output).reduce((acc, [key, value]) => {
1926
- if (value === null) {
1927
- return acc;
1928
- }
1929
- acc[key] = de_MessageAttributeValue(value, context);
1930
- return acc;
1931
- }, {});
1932
- };
1933
- const de_MessageList = (output, context) => {
1934
- const retVal = (output || [])
1935
- .filter((e) => e != null)
1936
- .map((entry) => {
1937
- return de_Message(entry, context);
1938
- });
1939
- return retVal;
1940
- };
1941
- const de_ReceiveMessageResult = (output, context) => {
1942
- return (0, smithy_client_1.take)(output, {
1943
- Messages: (_) => de_MessageList(_, context),
1944
- });
1945
- };
1946
- const deserializeMetadata = (output) => ({
1947
- httpStatusCode: output.statusCode,
1948
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1949
- extendedRequestId: output.headers["x-amz-id-2"],
1950
- cfId: output.headers["x-amz-cf-id"],
1951
- });
1952
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1953
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SQSServiceException_1.SQSServiceException);
1954
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1955
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1956
- const contents = {
1957
- protocol,
1958
- hostname,
1959
- port,
1960
- method: "POST",
1961
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1962
- headers,
1963
- };
1964
- if (resolvedHostname !== undefined) {
1965
- contents.hostname = resolvedHostname;
1966
- }
1967
- if (body !== undefined) {
1968
- contents.body = body;
1969
- }
1970
- return new protocol_http_1.HttpRequest(contents);
1971
- };
1972
- function sharedHeaders(operation) {
1973
- return {
1974
- "content-type": "application/x-amz-json-1.0",
1975
- "x-amz-target": `AmazonSQS.${operation}`,
1976
- };
1977
- }
1978
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1979
- if (encoded.length) {
1980
- return JSON.parse(encoded);
1981
- }
1982
- return {};
1983
- });
1984
- const parseErrorBody = async (errorBody, context) => {
1985
- const value = await parseBody(errorBody, context);
1986
- value.message = value.message ?? value.Message;
1987
- return value;
1988
- };
1989
- const loadRestJsonErrorCode = (output, data) => {
1990
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1991
- const sanitizeErrorCode = (rawValue) => {
1992
- let cleanValue = rawValue;
1993
- if (typeof cleanValue === "number") {
1994
- cleanValue = cleanValue.toString();
1995
- }
1996
- if (cleanValue.indexOf(",") >= 0) {
1997
- cleanValue = cleanValue.split(",")[0];
1998
- }
1999
- if (cleanValue.indexOf(":") >= 0) {
2000
- cleanValue = cleanValue.split(":")[0];
2001
- }
2002
- if (cleanValue.indexOf("#") >= 0) {
2003
- cleanValue = cleanValue.split("#")[1];
2004
- }
2005
- return cleanValue;
2006
- };
2007
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2008
- if (headerKey !== undefined) {
2009
- return sanitizeErrorCode(output.headers[headerKey]);
2010
- }
2011
- if (data.code !== undefined) {
2012
- return sanitizeErrorCode(data.code);
2013
- }
2014
- if (data["__type"] !== undefined) {
2015
- return sanitizeErrorCode(data["__type"]);
2016
- }
2017
- };
2018
- const populateBodyWithQueryCompatibility = (parsedOutput, headers) => {
2019
- const queryErrorHeader = headers["x-amzn-query-error"];
2020
- if (parsedOutput.body !== undefined && queryErrorHeader != null) {
2021
- const codeAndType = queryErrorHeader.split(";");
2022
- parsedOutput.body.Code = codeAndType[0];
2023
- parsedOutput.body.Type = codeAndType[1];
2024
- }
2025
- };
1
+ module.exports = require("../index.js");