@aws-sdk/client-sqs 3.327.0 → 3.328.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 (74) hide show
  1. package/README.md +6 -10
  2. package/dist-cjs/commands/AddPermissionCommand.js +3 -3
  3. package/dist-cjs/commands/ChangeMessageVisibilityBatchCommand.js +3 -3
  4. package/dist-cjs/commands/ChangeMessageVisibilityCommand.js +3 -3
  5. package/dist-cjs/commands/CreateQueueCommand.js +3 -3
  6. package/dist-cjs/commands/DeleteMessageBatchCommand.js +3 -3
  7. package/dist-cjs/commands/DeleteMessageCommand.js +3 -3
  8. package/dist-cjs/commands/DeleteQueueCommand.js +3 -3
  9. package/dist-cjs/commands/GetQueueAttributesCommand.js +3 -3
  10. package/dist-cjs/commands/GetQueueUrlCommand.js +3 -3
  11. package/dist-cjs/commands/ListDeadLetterSourceQueuesCommand.js +3 -3
  12. package/dist-cjs/commands/ListQueueTagsCommand.js +3 -3
  13. package/dist-cjs/commands/ListQueuesCommand.js +3 -3
  14. package/dist-cjs/commands/PurgeQueueCommand.js +3 -3
  15. package/dist-cjs/commands/ReceiveMessageCommand.js +3 -3
  16. package/dist-cjs/commands/RemovePermissionCommand.js +3 -3
  17. package/dist-cjs/commands/SendMessageBatchCommand.js +3 -3
  18. package/dist-cjs/commands/SendMessageCommand.js +3 -3
  19. package/dist-cjs/commands/SetQueueAttributesCommand.js +3 -3
  20. package/dist-cjs/commands/TagQueueCommand.js +3 -3
  21. package/dist-cjs/commands/UntagQueueCommand.js +3 -3
  22. package/dist-cjs/models/models_0.js +29 -172
  23. package/dist-cjs/protocols/Aws_query.js +2127 -0
  24. package/dist-es/commands/AddPermissionCommand.js +1 -1
  25. package/dist-es/commands/ChangeMessageVisibilityBatchCommand.js +1 -1
  26. package/dist-es/commands/ChangeMessageVisibilityCommand.js +1 -1
  27. package/dist-es/commands/CreateQueueCommand.js +1 -1
  28. package/dist-es/commands/DeleteMessageBatchCommand.js +1 -1
  29. package/dist-es/commands/DeleteMessageCommand.js +1 -1
  30. package/dist-es/commands/DeleteQueueCommand.js +1 -1
  31. package/dist-es/commands/GetQueueAttributesCommand.js +1 -1
  32. package/dist-es/commands/GetQueueUrlCommand.js +1 -1
  33. package/dist-es/commands/ListDeadLetterSourceQueuesCommand.js +1 -1
  34. package/dist-es/commands/ListQueueTagsCommand.js +1 -1
  35. package/dist-es/commands/ListQueuesCommand.js +1 -1
  36. package/dist-es/commands/PurgeQueueCommand.js +1 -1
  37. package/dist-es/commands/ReceiveMessageCommand.js +1 -1
  38. package/dist-es/commands/RemovePermissionCommand.js +1 -1
  39. package/dist-es/commands/SendMessageBatchCommand.js +1 -1
  40. package/dist-es/commands/SendMessageCommand.js +1 -1
  41. package/dist-es/commands/SetQueueAttributesCommand.js +1 -1
  42. package/dist-es/commands/TagQueueCommand.js +1 -1
  43. package/dist-es/commands/UntagQueueCommand.js +1 -1
  44. package/dist-es/models/models_0.js +24 -156
  45. package/dist-es/protocols/Aws_query.js +2084 -0
  46. package/dist-types/SQS.d.ts +6 -10
  47. package/dist-types/SQSClient.d.ts +6 -10
  48. package/dist-types/commands/AddPermissionCommand.d.ts +23 -48
  49. package/dist-types/commands/ChangeMessageVisibilityBatchCommand.d.ts +12 -34
  50. package/dist-types/commands/ChangeMessageVisibilityCommand.d.ts +13 -47
  51. package/dist-types/commands/CreateQueueCommand.d.ts +18 -53
  52. package/dist-types/commands/DeleteMessageBatchCommand.d.ts +10 -31
  53. package/dist-types/commands/DeleteMessageCommand.d.ts +1 -29
  54. package/dist-types/commands/DeleteQueueCommand.d.ts +8 -44
  55. package/dist-types/commands/GetQueueAttributesCommand.d.ts +0 -28
  56. package/dist-types/commands/GetQueueUrlCommand.d.ts +4 -35
  57. package/dist-types/commands/ListDeadLetterSourceQueuesCommand.d.ts +10 -39
  58. package/dist-types/commands/ListQueueTagsCommand.d.ts +2 -34
  59. package/dist-types/commands/ListQueuesCommand.d.ts +11 -41
  60. package/dist-types/commands/PurgeQueueCommand.d.ts +5 -35
  61. package/dist-types/commands/ReceiveMessageCommand.d.ts +14 -87
  62. package/dist-types/commands/RemovePermissionCommand.d.ts +2 -34
  63. package/dist-types/commands/SendMessageBatchCommand.d.ts +13 -73
  64. package/dist-types/commands/SendMessageCommand.d.ts +0 -59
  65. package/dist-types/commands/SetQueueAttributesCommand.d.ts +3 -47
  66. package/dist-types/commands/TagQueueCommand.d.ts +1 -32
  67. package/dist-types/commands/UntagQueueCommand.d.ts +1 -32
  68. package/dist-types/models/models_0.d.ts +412 -926
  69. package/dist-types/protocols/{Aws_json1_0.d.ts → Aws_query.d.ts} +40 -40
  70. package/dist-types/ts3.4/models/models_0.d.ts +21 -78
  71. package/package.json +5 -4
  72. package/dist-cjs/protocols/Aws_json1_0.js +0 -1608
  73. package/dist-es/protocols/Aws_json1_0.js +0 -1565
  74. /package/dist-types/ts3.4/protocols/{Aws_json1_0.d.ts → Aws_query.d.ts} +0 -0
@@ -1,1565 +0,0 @@
1
- import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { _json, decorateServiceException as __decorateServiceException, expectString as __expectString, take, withBaseException, } from "@aws-sdk/smithy-client";
3
- import { BatchEntryIdsNotDistinct, BatchRequestTooLong, EmptyBatchRequest, InvalidAddress, InvalidAttributeName, InvalidAttributeValue, InvalidBatchEntryId, InvalidIdFormat, InvalidMessageContents, InvalidSecurity, KmsAccessDenied, KmsDisabled, KmsInvalidKeyUsage, KmsInvalidState, KmsNotFound, KmsOptInRequired, KmsThrottled, MessageNotInflight, OverLimit, PurgeQueueInProgress, QueueDeletedRecently, QueueDoesNotExist, QueueNameExists, ReceiptHandleIsInvalid, RequestThrottled, TooManyEntriesInBatchRequest, UnsupportedOperation, } from "../models/models_0";
4
- import { SQSServiceException as __BaseException } from "../models/SQSServiceException";
5
- export const se_AddPermissionCommand = async (input, context) => {
6
- const headers = sharedHeaders("AddPermission");
7
- let body;
8
- body = JSON.stringify(_json(input));
9
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
- };
11
- export const se_ChangeMessageVisibilityCommand = async (input, context) => {
12
- const headers = sharedHeaders("ChangeMessageVisibility");
13
- let body;
14
- body = JSON.stringify(_json(input));
15
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
- };
17
- export const se_ChangeMessageVisibilityBatchCommand = async (input, context) => {
18
- const headers = sharedHeaders("ChangeMessageVisibilityBatch");
19
- let body;
20
- body = JSON.stringify(_json(input));
21
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
- };
23
- export const se_CreateQueueCommand = async (input, context) => {
24
- const headers = sharedHeaders("CreateQueue");
25
- let body;
26
- body = JSON.stringify(_json(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- export const se_DeleteMessageCommand = async (input, context) => {
30
- const headers = sharedHeaders("DeleteMessage");
31
- let body;
32
- body = JSON.stringify(_json(input));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- export const se_DeleteMessageBatchCommand = async (input, context) => {
36
- const headers = sharedHeaders("DeleteMessageBatch");
37
- let body;
38
- body = JSON.stringify(_json(input));
39
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
- };
41
- export const se_DeleteQueueCommand = async (input, context) => {
42
- const headers = sharedHeaders("DeleteQueue");
43
- let body;
44
- body = JSON.stringify(_json(input));
45
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
- };
47
- export const se_GetQueueAttributesCommand = async (input, context) => {
48
- const headers = sharedHeaders("GetQueueAttributes");
49
- let body;
50
- body = JSON.stringify(_json(input));
51
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
52
- };
53
- export const se_GetQueueUrlCommand = async (input, context) => {
54
- const headers = sharedHeaders("GetQueueUrl");
55
- let body;
56
- body = JSON.stringify(_json(input));
57
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
- };
59
- export const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
60
- const headers = sharedHeaders("ListDeadLetterSourceQueues");
61
- let body;
62
- body = JSON.stringify(_json(input));
63
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
64
- };
65
- export const se_ListQueuesCommand = async (input, context) => {
66
- const headers = sharedHeaders("ListQueues");
67
- let body;
68
- body = JSON.stringify(_json(input));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- export const se_ListQueueTagsCommand = async (input, context) => {
72
- const headers = sharedHeaders("ListQueueTags");
73
- let body;
74
- body = JSON.stringify(_json(input));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- export const se_PurgeQueueCommand = async (input, context) => {
78
- const headers = sharedHeaders("PurgeQueue");
79
- let body;
80
- body = JSON.stringify(_json(input));
81
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
82
- };
83
- export const se_ReceiveMessageCommand = async (input, context) => {
84
- const headers = sharedHeaders("ReceiveMessage");
85
- let body;
86
- body = JSON.stringify(_json(input));
87
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
88
- };
89
- export const se_RemovePermissionCommand = async (input, context) => {
90
- const headers = sharedHeaders("RemovePermission");
91
- let body;
92
- body = JSON.stringify(_json(input));
93
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
- };
95
- export const se_SendMessageCommand = async (input, context) => {
96
- const headers = sharedHeaders("SendMessage");
97
- let body;
98
- body = JSON.stringify(se_SendMessageRequest(input, context));
99
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
100
- };
101
- export const se_SendMessageBatchCommand = async (input, context) => {
102
- const headers = sharedHeaders("SendMessageBatch");
103
- let body;
104
- body = JSON.stringify(se_SendMessageBatchRequest(input, context));
105
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
106
- };
107
- export const se_SetQueueAttributesCommand = async (input, context) => {
108
- const headers = sharedHeaders("SetQueueAttributes");
109
- let body;
110
- body = JSON.stringify(_json(input));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- export const se_TagQueueCommand = async (input, context) => {
114
- const headers = sharedHeaders("TagQueue");
115
- let body;
116
- body = JSON.stringify(_json(input));
117
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
118
- };
119
- export const se_UntagQueueCommand = async (input, context) => {
120
- const headers = sharedHeaders("UntagQueue");
121
- let body;
122
- body = JSON.stringify(_json(input));
123
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
124
- };
125
- export const de_AddPermissionCommand = async (output, context) => {
126
- if (output.statusCode >= 300) {
127
- return de_AddPermissionCommandError(output, context);
128
- }
129
- await collectBody(output.body, context);
130
- const response = {
131
- $metadata: deserializeMetadata(output),
132
- };
133
- return response;
134
- };
135
- const de_AddPermissionCommandError = async (output, context) => {
136
- const parsedOutput = {
137
- ...output,
138
- body: await parseErrorBody(output.body, context),
139
- };
140
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
141
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
142
- switch (errorCode) {
143
- case "InvalidAddress":
144
- case "com.amazonaws.sqs#InvalidAddress":
145
- throw await de_InvalidAddressRes(parsedOutput, context);
146
- case "InvalidSecurity":
147
- case "com.amazonaws.sqs#InvalidSecurity":
148
- throw await de_InvalidSecurityRes(parsedOutput, context);
149
- case "OverLimit":
150
- case "com.amazonaws.sqs#OverLimit":
151
- throw await de_OverLimitRes(parsedOutput, context);
152
- case "QueueDoesNotExist":
153
- case "com.amazonaws.sqs#QueueDoesNotExist":
154
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
155
- case "RequestThrottled":
156
- case "com.amazonaws.sqs#RequestThrottled":
157
- throw await de_RequestThrottledRes(parsedOutput, context);
158
- case "UnsupportedOperation":
159
- case "com.amazonaws.sqs#UnsupportedOperation":
160
- throw await de_UnsupportedOperationRes(parsedOutput, context);
161
- default:
162
- const parsedBody = parsedOutput.body;
163
- return throwDefaultError({
164
- output,
165
- parsedBody,
166
- errorCode,
167
- });
168
- }
169
- };
170
- export const de_ChangeMessageVisibilityCommand = async (output, context) => {
171
- if (output.statusCode >= 300) {
172
- return de_ChangeMessageVisibilityCommandError(output, context);
173
- }
174
- await collectBody(output.body, context);
175
- const response = {
176
- $metadata: deserializeMetadata(output),
177
- };
178
- return response;
179
- };
180
- const de_ChangeMessageVisibilityCommandError = async (output, context) => {
181
- const parsedOutput = {
182
- ...output,
183
- body: await parseErrorBody(output.body, context),
184
- };
185
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
186
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
187
- switch (errorCode) {
188
- case "MessageNotInflight":
189
- case "com.amazonaws.sqs#MessageNotInflight":
190
- throw await de_MessageNotInflightRes(parsedOutput, context);
191
- case "QueueDoesNotExist":
192
- case "com.amazonaws.sqs#QueueDoesNotExist":
193
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
194
- case "ReceiptHandleIsInvalid":
195
- case "com.amazonaws.sqs#ReceiptHandleIsInvalid":
196
- throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
197
- case "RequestThrottled":
198
- case "com.amazonaws.sqs#RequestThrottled":
199
- throw await de_RequestThrottledRes(parsedOutput, context);
200
- case "UnsupportedOperation":
201
- case "com.amazonaws.sqs#UnsupportedOperation":
202
- throw await de_UnsupportedOperationRes(parsedOutput, context);
203
- default:
204
- const parsedBody = parsedOutput.body;
205
- return throwDefaultError({
206
- output,
207
- parsedBody,
208
- errorCode,
209
- });
210
- }
211
- };
212
- export const de_ChangeMessageVisibilityBatchCommand = async (output, context) => {
213
- if (output.statusCode >= 300) {
214
- return de_ChangeMessageVisibilityBatchCommandError(output, context);
215
- }
216
- const data = await parseBody(output.body, context);
217
- let contents = {};
218
- contents = _json(data);
219
- const response = {
220
- $metadata: deserializeMetadata(output),
221
- ...contents,
222
- };
223
- return response;
224
- };
225
- const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
226
- const parsedOutput = {
227
- ...output,
228
- body: await parseErrorBody(output.body, context),
229
- };
230
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
231
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
232
- switch (errorCode) {
233
- case "BatchEntryIdsNotDistinct":
234
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
235
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
236
- case "EmptyBatchRequest":
237
- case "com.amazonaws.sqs#EmptyBatchRequest":
238
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
239
- case "InvalidBatchEntryId":
240
- case "com.amazonaws.sqs#InvalidBatchEntryId":
241
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
242
- case "QueueDoesNotExist":
243
- case "com.amazonaws.sqs#QueueDoesNotExist":
244
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
245
- case "RequestThrottled":
246
- case "com.amazonaws.sqs#RequestThrottled":
247
- throw await de_RequestThrottledRes(parsedOutput, context);
248
- case "TooManyEntriesInBatchRequest":
249
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
250
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
251
- case "UnsupportedOperation":
252
- case "com.amazonaws.sqs#UnsupportedOperation":
253
- throw await de_UnsupportedOperationRes(parsedOutput, context);
254
- default:
255
- const parsedBody = parsedOutput.body;
256
- return throwDefaultError({
257
- output,
258
- parsedBody,
259
- errorCode,
260
- });
261
- }
262
- };
263
- export const de_CreateQueueCommand = async (output, context) => {
264
- if (output.statusCode >= 300) {
265
- return de_CreateQueueCommandError(output, context);
266
- }
267
- const data = await parseBody(output.body, context);
268
- let contents = {};
269
- contents = _json(data);
270
- const response = {
271
- $metadata: deserializeMetadata(output),
272
- ...contents,
273
- };
274
- return response;
275
- };
276
- const de_CreateQueueCommandError = async (output, context) => {
277
- const parsedOutput = {
278
- ...output,
279
- body: await parseErrorBody(output.body, context),
280
- };
281
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
282
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
283
- switch (errorCode) {
284
- case "InvalidAddress":
285
- case "com.amazonaws.sqs#InvalidAddress":
286
- throw await de_InvalidAddressRes(parsedOutput, context);
287
- case "InvalidAttributeName":
288
- case "com.amazonaws.sqs#InvalidAttributeName":
289
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
290
- case "InvalidAttributeValue":
291
- case "com.amazonaws.sqs#InvalidAttributeValue":
292
- throw await de_InvalidAttributeValueRes(parsedOutput, context);
293
- case "InvalidSecurity":
294
- case "com.amazonaws.sqs#InvalidSecurity":
295
- throw await de_InvalidSecurityRes(parsedOutput, context);
296
- case "QueueDeletedRecently":
297
- case "com.amazonaws.sqs#QueueDeletedRecently":
298
- throw await de_QueueDeletedRecentlyRes(parsedOutput, context);
299
- case "QueueNameExists":
300
- case "com.amazonaws.sqs#QueueNameExists":
301
- throw await de_QueueNameExistsRes(parsedOutput, context);
302
- case "RequestThrottled":
303
- case "com.amazonaws.sqs#RequestThrottled":
304
- throw await de_RequestThrottledRes(parsedOutput, context);
305
- case "UnsupportedOperation":
306
- case "com.amazonaws.sqs#UnsupportedOperation":
307
- throw await de_UnsupportedOperationRes(parsedOutput, context);
308
- default:
309
- const parsedBody = parsedOutput.body;
310
- return throwDefaultError({
311
- output,
312
- parsedBody,
313
- errorCode,
314
- });
315
- }
316
- };
317
- export const de_DeleteMessageCommand = async (output, context) => {
318
- if (output.statusCode >= 300) {
319
- return de_DeleteMessageCommandError(output, context);
320
- }
321
- await collectBody(output.body, context);
322
- const response = {
323
- $metadata: deserializeMetadata(output),
324
- };
325
- return response;
326
- };
327
- const de_DeleteMessageCommandError = async (output, context) => {
328
- const parsedOutput = {
329
- ...output,
330
- body: await parseErrorBody(output.body, context),
331
- };
332
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
333
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
334
- switch (errorCode) {
335
- case "InvalidIdFormat":
336
- case "com.amazonaws.sqs#InvalidIdFormat":
337
- throw await de_InvalidIdFormatRes(parsedOutput, context);
338
- case "InvalidSecurity":
339
- case "com.amazonaws.sqs#InvalidSecurity":
340
- throw await de_InvalidSecurityRes(parsedOutput, context);
341
- case "QueueDoesNotExist":
342
- case "com.amazonaws.sqs#QueueDoesNotExist":
343
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
344
- case "ReceiptHandleIsInvalid":
345
- case "com.amazonaws.sqs#ReceiptHandleIsInvalid":
346
- throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
347
- case "RequestThrottled":
348
- case "com.amazonaws.sqs#RequestThrottled":
349
- throw await de_RequestThrottledRes(parsedOutput, context);
350
- case "UnsupportedOperation":
351
- case "com.amazonaws.sqs#UnsupportedOperation":
352
- throw await de_UnsupportedOperationRes(parsedOutput, context);
353
- default:
354
- const parsedBody = parsedOutput.body;
355
- return throwDefaultError({
356
- output,
357
- parsedBody,
358
- errorCode,
359
- });
360
- }
361
- };
362
- export const de_DeleteMessageBatchCommand = async (output, context) => {
363
- if (output.statusCode >= 300) {
364
- return de_DeleteMessageBatchCommandError(output, context);
365
- }
366
- const data = await parseBody(output.body, context);
367
- let contents = {};
368
- contents = _json(data);
369
- const response = {
370
- $metadata: deserializeMetadata(output),
371
- ...contents,
372
- };
373
- return response;
374
- };
375
- const de_DeleteMessageBatchCommandError = async (output, context) => {
376
- const parsedOutput = {
377
- ...output,
378
- body: await parseErrorBody(output.body, context),
379
- };
380
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
381
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
382
- switch (errorCode) {
383
- case "BatchEntryIdsNotDistinct":
384
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
385
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
386
- case "EmptyBatchRequest":
387
- case "com.amazonaws.sqs#EmptyBatchRequest":
388
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
389
- case "InvalidBatchEntryId":
390
- case "com.amazonaws.sqs#InvalidBatchEntryId":
391
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
392
- case "QueueDoesNotExist":
393
- case "com.amazonaws.sqs#QueueDoesNotExist":
394
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
395
- case "RequestThrottled":
396
- case "com.amazonaws.sqs#RequestThrottled":
397
- throw await de_RequestThrottledRes(parsedOutput, context);
398
- case "TooManyEntriesInBatchRequest":
399
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
400
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
401
- case "UnsupportedOperation":
402
- case "com.amazonaws.sqs#UnsupportedOperation":
403
- throw await de_UnsupportedOperationRes(parsedOutput, context);
404
- default:
405
- const parsedBody = parsedOutput.body;
406
- return throwDefaultError({
407
- output,
408
- parsedBody,
409
- errorCode,
410
- });
411
- }
412
- };
413
- export const de_DeleteQueueCommand = async (output, context) => {
414
- if (output.statusCode >= 300) {
415
- return de_DeleteQueueCommandError(output, context);
416
- }
417
- await collectBody(output.body, context);
418
- const response = {
419
- $metadata: deserializeMetadata(output),
420
- };
421
- return response;
422
- };
423
- const de_DeleteQueueCommandError = async (output, context) => {
424
- const parsedOutput = {
425
- ...output,
426
- body: await parseErrorBody(output.body, context),
427
- };
428
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
429
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
430
- switch (errorCode) {
431
- case "InvalidAddress":
432
- case "com.amazonaws.sqs#InvalidAddress":
433
- throw await de_InvalidAddressRes(parsedOutput, context);
434
- case "InvalidSecurity":
435
- case "com.amazonaws.sqs#InvalidSecurity":
436
- throw await de_InvalidSecurityRes(parsedOutput, context);
437
- case "QueueDoesNotExist":
438
- case "com.amazonaws.sqs#QueueDoesNotExist":
439
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
440
- case "RequestThrottled":
441
- case "com.amazonaws.sqs#RequestThrottled":
442
- throw await de_RequestThrottledRes(parsedOutput, context);
443
- case "UnsupportedOperation":
444
- case "com.amazonaws.sqs#UnsupportedOperation":
445
- throw await de_UnsupportedOperationRes(parsedOutput, context);
446
- default:
447
- const parsedBody = parsedOutput.body;
448
- return throwDefaultError({
449
- output,
450
- parsedBody,
451
- errorCode,
452
- });
453
- }
454
- };
455
- export const de_GetQueueAttributesCommand = async (output, context) => {
456
- if (output.statusCode >= 300) {
457
- return de_GetQueueAttributesCommandError(output, context);
458
- }
459
- const data = await parseBody(output.body, context);
460
- let contents = {};
461
- contents = _json(data);
462
- const response = {
463
- $metadata: deserializeMetadata(output),
464
- ...contents,
465
- };
466
- return response;
467
- };
468
- const de_GetQueueAttributesCommandError = async (output, context) => {
469
- const parsedOutput = {
470
- ...output,
471
- body: await parseErrorBody(output.body, context),
472
- };
473
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
474
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
475
- switch (errorCode) {
476
- case "InvalidAttributeName":
477
- case "com.amazonaws.sqs#InvalidAttributeName":
478
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
479
- case "InvalidSecurity":
480
- case "com.amazonaws.sqs#InvalidSecurity":
481
- throw await de_InvalidSecurityRes(parsedOutput, context);
482
- case "QueueDoesNotExist":
483
- case "com.amazonaws.sqs#QueueDoesNotExist":
484
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
485
- case "RequestThrottled":
486
- case "com.amazonaws.sqs#RequestThrottled":
487
- throw await de_RequestThrottledRes(parsedOutput, context);
488
- case "UnsupportedOperation":
489
- case "com.amazonaws.sqs#UnsupportedOperation":
490
- throw await de_UnsupportedOperationRes(parsedOutput, context);
491
- default:
492
- const parsedBody = parsedOutput.body;
493
- return throwDefaultError({
494
- output,
495
- parsedBody,
496
- errorCode,
497
- });
498
- }
499
- };
500
- export const de_GetQueueUrlCommand = async (output, context) => {
501
- if (output.statusCode >= 300) {
502
- return de_GetQueueUrlCommandError(output, context);
503
- }
504
- const data = await parseBody(output.body, context);
505
- let contents = {};
506
- contents = _json(data);
507
- const response = {
508
- $metadata: deserializeMetadata(output),
509
- ...contents,
510
- };
511
- return response;
512
- };
513
- const de_GetQueueUrlCommandError = async (output, context) => {
514
- const parsedOutput = {
515
- ...output,
516
- body: await parseErrorBody(output.body, context),
517
- };
518
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
519
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
520
- switch (errorCode) {
521
- case "InvalidAddress":
522
- case "com.amazonaws.sqs#InvalidAddress":
523
- throw await de_InvalidAddressRes(parsedOutput, context);
524
- case "InvalidSecurity":
525
- case "com.amazonaws.sqs#InvalidSecurity":
526
- throw await de_InvalidSecurityRes(parsedOutput, context);
527
- case "QueueDoesNotExist":
528
- case "com.amazonaws.sqs#QueueDoesNotExist":
529
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
530
- case "RequestThrottled":
531
- case "com.amazonaws.sqs#RequestThrottled":
532
- throw await de_RequestThrottledRes(parsedOutput, context);
533
- case "UnsupportedOperation":
534
- case "com.amazonaws.sqs#UnsupportedOperation":
535
- throw await de_UnsupportedOperationRes(parsedOutput, context);
536
- default:
537
- const parsedBody = parsedOutput.body;
538
- return throwDefaultError({
539
- output,
540
- parsedBody,
541
- errorCode,
542
- });
543
- }
544
- };
545
- export const de_ListDeadLetterSourceQueuesCommand = async (output, context) => {
546
- if (output.statusCode >= 300) {
547
- return de_ListDeadLetterSourceQueuesCommandError(output, context);
548
- }
549
- const data = await parseBody(output.body, context);
550
- let contents = {};
551
- contents = _json(data);
552
- const response = {
553
- $metadata: deserializeMetadata(output),
554
- ...contents,
555
- };
556
- return response;
557
- };
558
- const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
559
- const parsedOutput = {
560
- ...output,
561
- body: await parseErrorBody(output.body, context),
562
- };
563
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
564
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
565
- switch (errorCode) {
566
- case "InvalidAddress":
567
- case "com.amazonaws.sqs#InvalidAddress":
568
- throw await de_InvalidAddressRes(parsedOutput, context);
569
- case "InvalidSecurity":
570
- case "com.amazonaws.sqs#InvalidSecurity":
571
- throw await de_InvalidSecurityRes(parsedOutput, context);
572
- case "QueueDoesNotExist":
573
- case "com.amazonaws.sqs#QueueDoesNotExist":
574
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
575
- case "RequestThrottled":
576
- case "com.amazonaws.sqs#RequestThrottled":
577
- throw await de_RequestThrottledRes(parsedOutput, context);
578
- case "UnsupportedOperation":
579
- case "com.amazonaws.sqs#UnsupportedOperation":
580
- throw await de_UnsupportedOperationRes(parsedOutput, context);
581
- default:
582
- const parsedBody = parsedOutput.body;
583
- return throwDefaultError({
584
- output,
585
- parsedBody,
586
- errorCode,
587
- });
588
- }
589
- };
590
- export const de_ListQueuesCommand = async (output, context) => {
591
- if (output.statusCode >= 300) {
592
- return de_ListQueuesCommandError(output, context);
593
- }
594
- const data = await parseBody(output.body, context);
595
- let contents = {};
596
- contents = _json(data);
597
- const response = {
598
- $metadata: deserializeMetadata(output),
599
- ...contents,
600
- };
601
- return response;
602
- };
603
- const de_ListQueuesCommandError = async (output, context) => {
604
- const parsedOutput = {
605
- ...output,
606
- body: await parseErrorBody(output.body, context),
607
- };
608
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
609
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
610
- switch (errorCode) {
611
- case "InvalidAddress":
612
- case "com.amazonaws.sqs#InvalidAddress":
613
- throw await de_InvalidAddressRes(parsedOutput, context);
614
- case "InvalidSecurity":
615
- case "com.amazonaws.sqs#InvalidSecurity":
616
- throw await de_InvalidSecurityRes(parsedOutput, context);
617
- case "RequestThrottled":
618
- case "com.amazonaws.sqs#RequestThrottled":
619
- throw await de_RequestThrottledRes(parsedOutput, context);
620
- case "UnsupportedOperation":
621
- case "com.amazonaws.sqs#UnsupportedOperation":
622
- throw await de_UnsupportedOperationRes(parsedOutput, context);
623
- default:
624
- const parsedBody = parsedOutput.body;
625
- return throwDefaultError({
626
- output,
627
- parsedBody,
628
- errorCode,
629
- });
630
- }
631
- };
632
- export const de_ListQueueTagsCommand = async (output, context) => {
633
- if (output.statusCode >= 300) {
634
- return de_ListQueueTagsCommandError(output, context);
635
- }
636
- const data = await parseBody(output.body, context);
637
- let contents = {};
638
- contents = _json(data);
639
- const response = {
640
- $metadata: deserializeMetadata(output),
641
- ...contents,
642
- };
643
- return response;
644
- };
645
- const de_ListQueueTagsCommandError = async (output, context) => {
646
- const parsedOutput = {
647
- ...output,
648
- body: await parseErrorBody(output.body, context),
649
- };
650
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
651
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
652
- switch (errorCode) {
653
- case "InvalidAddress":
654
- case "com.amazonaws.sqs#InvalidAddress":
655
- throw await de_InvalidAddressRes(parsedOutput, context);
656
- case "InvalidSecurity":
657
- case "com.amazonaws.sqs#InvalidSecurity":
658
- throw await de_InvalidSecurityRes(parsedOutput, context);
659
- case "QueueDoesNotExist":
660
- case "com.amazonaws.sqs#QueueDoesNotExist":
661
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
662
- case "RequestThrottled":
663
- case "com.amazonaws.sqs#RequestThrottled":
664
- throw await de_RequestThrottledRes(parsedOutput, context);
665
- case "UnsupportedOperation":
666
- case "com.amazonaws.sqs#UnsupportedOperation":
667
- throw await de_UnsupportedOperationRes(parsedOutput, context);
668
- default:
669
- const parsedBody = parsedOutput.body;
670
- return throwDefaultError({
671
- output,
672
- parsedBody,
673
- errorCode,
674
- });
675
- }
676
- };
677
- export const de_PurgeQueueCommand = async (output, context) => {
678
- if (output.statusCode >= 300) {
679
- return de_PurgeQueueCommandError(output, context);
680
- }
681
- await collectBody(output.body, context);
682
- const response = {
683
- $metadata: deserializeMetadata(output),
684
- };
685
- return response;
686
- };
687
- const de_PurgeQueueCommandError = async (output, context) => {
688
- const parsedOutput = {
689
- ...output,
690
- body: await parseErrorBody(output.body, context),
691
- };
692
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
693
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
- switch (errorCode) {
695
- case "InvalidAddress":
696
- case "com.amazonaws.sqs#InvalidAddress":
697
- throw await de_InvalidAddressRes(parsedOutput, context);
698
- case "InvalidSecurity":
699
- case "com.amazonaws.sqs#InvalidSecurity":
700
- throw await de_InvalidSecurityRes(parsedOutput, context);
701
- case "PurgeQueueInProgress":
702
- case "com.amazonaws.sqs#PurgeQueueInProgress":
703
- throw await de_PurgeQueueInProgressRes(parsedOutput, context);
704
- case "QueueDoesNotExist":
705
- case "com.amazonaws.sqs#QueueDoesNotExist":
706
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
707
- case "RequestThrottled":
708
- case "com.amazonaws.sqs#RequestThrottled":
709
- throw await de_RequestThrottledRes(parsedOutput, context);
710
- case "UnsupportedOperation":
711
- case "com.amazonaws.sqs#UnsupportedOperation":
712
- throw await de_UnsupportedOperationRes(parsedOutput, context);
713
- default:
714
- const parsedBody = parsedOutput.body;
715
- return throwDefaultError({
716
- output,
717
- parsedBody,
718
- errorCode,
719
- });
720
- }
721
- };
722
- export const de_ReceiveMessageCommand = async (output, context) => {
723
- if (output.statusCode >= 300) {
724
- return de_ReceiveMessageCommandError(output, context);
725
- }
726
- const data = await parseBody(output.body, context);
727
- let contents = {};
728
- contents = de_ReceiveMessageResult(data, context);
729
- const response = {
730
- $metadata: deserializeMetadata(output),
731
- ...contents,
732
- };
733
- return response;
734
- };
735
- const de_ReceiveMessageCommandError = async (output, context) => {
736
- const parsedOutput = {
737
- ...output,
738
- body: await parseErrorBody(output.body, context),
739
- };
740
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
741
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
742
- switch (errorCode) {
743
- case "InvalidSecurity":
744
- case "com.amazonaws.sqs#InvalidSecurity":
745
- throw await de_InvalidSecurityRes(parsedOutput, context);
746
- case "KmsAccessDenied":
747
- case "com.amazonaws.sqs#KmsAccessDenied":
748
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
749
- case "KmsDisabled":
750
- case "com.amazonaws.sqs#KmsDisabled":
751
- throw await de_KmsDisabledRes(parsedOutput, context);
752
- case "KmsInvalidKeyUsage":
753
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
754
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
755
- case "KmsInvalidState":
756
- case "com.amazonaws.sqs#KmsInvalidState":
757
- throw await de_KmsInvalidStateRes(parsedOutput, context);
758
- case "KmsNotFound":
759
- case "com.amazonaws.sqs#KmsNotFound":
760
- throw await de_KmsNotFoundRes(parsedOutput, context);
761
- case "KmsOptInRequired":
762
- case "com.amazonaws.sqs#KmsOptInRequired":
763
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
764
- case "KmsThrottled":
765
- case "com.amazonaws.sqs#KmsThrottled":
766
- throw await de_KmsThrottledRes(parsedOutput, context);
767
- case "OverLimit":
768
- case "com.amazonaws.sqs#OverLimit":
769
- throw await de_OverLimitRes(parsedOutput, context);
770
- case "QueueDoesNotExist":
771
- case "com.amazonaws.sqs#QueueDoesNotExist":
772
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
773
- case "RequestThrottled":
774
- case "com.amazonaws.sqs#RequestThrottled":
775
- throw await de_RequestThrottledRes(parsedOutput, context);
776
- case "UnsupportedOperation":
777
- case "com.amazonaws.sqs#UnsupportedOperation":
778
- throw await de_UnsupportedOperationRes(parsedOutput, context);
779
- default:
780
- const parsedBody = parsedOutput.body;
781
- return throwDefaultError({
782
- output,
783
- parsedBody,
784
- errorCode,
785
- });
786
- }
787
- };
788
- export const de_RemovePermissionCommand = async (output, context) => {
789
- if (output.statusCode >= 300) {
790
- return de_RemovePermissionCommandError(output, context);
791
- }
792
- await collectBody(output.body, context);
793
- const response = {
794
- $metadata: deserializeMetadata(output),
795
- };
796
- return response;
797
- };
798
- const de_RemovePermissionCommandError = async (output, context) => {
799
- const parsedOutput = {
800
- ...output,
801
- body: await parseErrorBody(output.body, context),
802
- };
803
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
804
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
805
- switch (errorCode) {
806
- case "InvalidAddress":
807
- case "com.amazonaws.sqs#InvalidAddress":
808
- throw await de_InvalidAddressRes(parsedOutput, context);
809
- case "InvalidSecurity":
810
- case "com.amazonaws.sqs#InvalidSecurity":
811
- throw await de_InvalidSecurityRes(parsedOutput, context);
812
- case "QueueDoesNotExist":
813
- case "com.amazonaws.sqs#QueueDoesNotExist":
814
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
815
- case "RequestThrottled":
816
- case "com.amazonaws.sqs#RequestThrottled":
817
- throw await de_RequestThrottledRes(parsedOutput, context);
818
- case "UnsupportedOperation":
819
- case "com.amazonaws.sqs#UnsupportedOperation":
820
- throw await de_UnsupportedOperationRes(parsedOutput, context);
821
- default:
822
- const parsedBody = parsedOutput.body;
823
- return throwDefaultError({
824
- output,
825
- parsedBody,
826
- errorCode,
827
- });
828
- }
829
- };
830
- export const de_SendMessageCommand = async (output, context) => {
831
- if (output.statusCode >= 300) {
832
- return de_SendMessageCommandError(output, context);
833
- }
834
- const data = await parseBody(output.body, context);
835
- let contents = {};
836
- contents = _json(data);
837
- const response = {
838
- $metadata: deserializeMetadata(output),
839
- ...contents,
840
- };
841
- return response;
842
- };
843
- const de_SendMessageCommandError = async (output, context) => {
844
- const parsedOutput = {
845
- ...output,
846
- body: await parseErrorBody(output.body, context),
847
- };
848
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
849
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
850
- switch (errorCode) {
851
- case "InvalidMessageContents":
852
- case "com.amazonaws.sqs#InvalidMessageContents":
853
- throw await de_InvalidMessageContentsRes(parsedOutput, context);
854
- case "InvalidSecurity":
855
- case "com.amazonaws.sqs#InvalidSecurity":
856
- throw await de_InvalidSecurityRes(parsedOutput, context);
857
- case "KmsAccessDenied":
858
- case "com.amazonaws.sqs#KmsAccessDenied":
859
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
860
- case "KmsDisabled":
861
- case "com.amazonaws.sqs#KmsDisabled":
862
- throw await de_KmsDisabledRes(parsedOutput, context);
863
- case "KmsInvalidKeyUsage":
864
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
865
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
866
- case "KmsInvalidState":
867
- case "com.amazonaws.sqs#KmsInvalidState":
868
- throw await de_KmsInvalidStateRes(parsedOutput, context);
869
- case "KmsNotFound":
870
- case "com.amazonaws.sqs#KmsNotFound":
871
- throw await de_KmsNotFoundRes(parsedOutput, context);
872
- case "KmsOptInRequired":
873
- case "com.amazonaws.sqs#KmsOptInRequired":
874
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
875
- case "KmsThrottled":
876
- case "com.amazonaws.sqs#KmsThrottled":
877
- throw await de_KmsThrottledRes(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
- export const de_SendMessageBatchCommand = async (output, context) => {
897
- if (output.statusCode >= 300) {
898
- return de_SendMessageBatchCommandError(output, context);
899
- }
900
- const data = await parseBody(output.body, context);
901
- let contents = {};
902
- contents = _json(data);
903
- const response = {
904
- $metadata: deserializeMetadata(output),
905
- ...contents,
906
- };
907
- return response;
908
- };
909
- const de_SendMessageBatchCommandError = async (output, context) => {
910
- const parsedOutput = {
911
- ...output,
912
- body: await parseErrorBody(output.body, context),
913
- };
914
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
915
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
916
- switch (errorCode) {
917
- case "BatchEntryIdsNotDistinct":
918
- case "com.amazonaws.sqs#BatchEntryIdsNotDistinct":
919
- throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context);
920
- case "BatchRequestTooLong":
921
- case "com.amazonaws.sqs#BatchRequestTooLong":
922
- throw await de_BatchRequestTooLongRes(parsedOutput, context);
923
- case "EmptyBatchRequest":
924
- case "com.amazonaws.sqs#EmptyBatchRequest":
925
- throw await de_EmptyBatchRequestRes(parsedOutput, context);
926
- case "InvalidBatchEntryId":
927
- case "com.amazonaws.sqs#InvalidBatchEntryId":
928
- throw await de_InvalidBatchEntryIdRes(parsedOutput, context);
929
- case "InvalidSecurity":
930
- case "com.amazonaws.sqs#InvalidSecurity":
931
- throw await de_InvalidSecurityRes(parsedOutput, context);
932
- case "KmsAccessDenied":
933
- case "com.amazonaws.sqs#KmsAccessDenied":
934
- throw await de_KmsAccessDeniedRes(parsedOutput, context);
935
- case "KmsDisabled":
936
- case "com.amazonaws.sqs#KmsDisabled":
937
- throw await de_KmsDisabledRes(parsedOutput, context);
938
- case "KmsInvalidKeyUsage":
939
- case "com.amazonaws.sqs#KmsInvalidKeyUsage":
940
- throw await de_KmsInvalidKeyUsageRes(parsedOutput, context);
941
- case "KmsInvalidState":
942
- case "com.amazonaws.sqs#KmsInvalidState":
943
- throw await de_KmsInvalidStateRes(parsedOutput, context);
944
- case "KmsNotFound":
945
- case "com.amazonaws.sqs#KmsNotFound":
946
- throw await de_KmsNotFoundRes(parsedOutput, context);
947
- case "KmsOptInRequired":
948
- case "com.amazonaws.sqs#KmsOptInRequired":
949
- throw await de_KmsOptInRequiredRes(parsedOutput, context);
950
- case "KmsThrottled":
951
- case "com.amazonaws.sqs#KmsThrottled":
952
- throw await de_KmsThrottledRes(parsedOutput, context);
953
- case "QueueDoesNotExist":
954
- case "com.amazonaws.sqs#QueueDoesNotExist":
955
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
956
- case "RequestThrottled":
957
- case "com.amazonaws.sqs#RequestThrottled":
958
- throw await de_RequestThrottledRes(parsedOutput, context);
959
- case "TooManyEntriesInBatchRequest":
960
- case "com.amazonaws.sqs#TooManyEntriesInBatchRequest":
961
- throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
962
- case "UnsupportedOperation":
963
- case "com.amazonaws.sqs#UnsupportedOperation":
964
- throw await de_UnsupportedOperationRes(parsedOutput, context);
965
- default:
966
- const parsedBody = parsedOutput.body;
967
- return throwDefaultError({
968
- output,
969
- parsedBody,
970
- errorCode,
971
- });
972
- }
973
- };
974
- export const de_SetQueueAttributesCommand = async (output, context) => {
975
- if (output.statusCode >= 300) {
976
- return de_SetQueueAttributesCommandError(output, context);
977
- }
978
- await collectBody(output.body, context);
979
- const response = {
980
- $metadata: deserializeMetadata(output),
981
- };
982
- return response;
983
- };
984
- const de_SetQueueAttributesCommandError = async (output, context) => {
985
- const parsedOutput = {
986
- ...output,
987
- body: await parseErrorBody(output.body, context),
988
- };
989
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
990
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
991
- switch (errorCode) {
992
- case "InvalidAddress":
993
- case "com.amazonaws.sqs#InvalidAddress":
994
- throw await de_InvalidAddressRes(parsedOutput, context);
995
- case "InvalidAttributeName":
996
- case "com.amazonaws.sqs#InvalidAttributeName":
997
- throw await de_InvalidAttributeNameRes(parsedOutput, context);
998
- case "InvalidAttributeValue":
999
- case "com.amazonaws.sqs#InvalidAttributeValue":
1000
- throw await de_InvalidAttributeValueRes(parsedOutput, context);
1001
- case "InvalidSecurity":
1002
- case "com.amazonaws.sqs#InvalidSecurity":
1003
- throw await de_InvalidSecurityRes(parsedOutput, context);
1004
- case "OverLimit":
1005
- case "com.amazonaws.sqs#OverLimit":
1006
- throw await de_OverLimitRes(parsedOutput, context);
1007
- case "QueueDoesNotExist":
1008
- case "com.amazonaws.sqs#QueueDoesNotExist":
1009
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1010
- case "RequestThrottled":
1011
- case "com.amazonaws.sqs#RequestThrottled":
1012
- throw await de_RequestThrottledRes(parsedOutput, context);
1013
- case "UnsupportedOperation":
1014
- case "com.amazonaws.sqs#UnsupportedOperation":
1015
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1016
- default:
1017
- const parsedBody = parsedOutput.body;
1018
- return throwDefaultError({
1019
- output,
1020
- parsedBody,
1021
- errorCode,
1022
- });
1023
- }
1024
- };
1025
- export const de_TagQueueCommand = async (output, context) => {
1026
- if (output.statusCode >= 300) {
1027
- return de_TagQueueCommandError(output, context);
1028
- }
1029
- await collectBody(output.body, context);
1030
- const response = {
1031
- $metadata: deserializeMetadata(output),
1032
- };
1033
- return response;
1034
- };
1035
- const de_TagQueueCommandError = async (output, context) => {
1036
- const parsedOutput = {
1037
- ...output,
1038
- body: await parseErrorBody(output.body, context),
1039
- };
1040
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1041
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1042
- switch (errorCode) {
1043
- case "InvalidAddress":
1044
- case "com.amazonaws.sqs#InvalidAddress":
1045
- throw await de_InvalidAddressRes(parsedOutput, context);
1046
- case "InvalidSecurity":
1047
- case "com.amazonaws.sqs#InvalidSecurity":
1048
- throw await de_InvalidSecurityRes(parsedOutput, context);
1049
- case "QueueDoesNotExist":
1050
- case "com.amazonaws.sqs#QueueDoesNotExist":
1051
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1052
- case "RequestThrottled":
1053
- case "com.amazonaws.sqs#RequestThrottled":
1054
- throw await de_RequestThrottledRes(parsedOutput, context);
1055
- case "UnsupportedOperation":
1056
- case "com.amazonaws.sqs#UnsupportedOperation":
1057
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1058
- default:
1059
- const parsedBody = parsedOutput.body;
1060
- return throwDefaultError({
1061
- output,
1062
- parsedBody,
1063
- errorCode,
1064
- });
1065
- }
1066
- };
1067
- export const de_UntagQueueCommand = async (output, context) => {
1068
- if (output.statusCode >= 300) {
1069
- return de_UntagQueueCommandError(output, context);
1070
- }
1071
- await collectBody(output.body, context);
1072
- const response = {
1073
- $metadata: deserializeMetadata(output),
1074
- };
1075
- return response;
1076
- };
1077
- const de_UntagQueueCommandError = async (output, context) => {
1078
- const parsedOutput = {
1079
- ...output,
1080
- body: await parseErrorBody(output.body, context),
1081
- };
1082
- populateBodyWithQueryCompatibility(parsedOutput, output.headers);
1083
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1084
- switch (errorCode) {
1085
- case "InvalidAddress":
1086
- case "com.amazonaws.sqs#InvalidAddress":
1087
- throw await de_InvalidAddressRes(parsedOutput, context);
1088
- case "InvalidSecurity":
1089
- case "com.amazonaws.sqs#InvalidSecurity":
1090
- throw await de_InvalidSecurityRes(parsedOutput, context);
1091
- case "QueueDoesNotExist":
1092
- case "com.amazonaws.sqs#QueueDoesNotExist":
1093
- throw await de_QueueDoesNotExistRes(parsedOutput, context);
1094
- case "RequestThrottled":
1095
- case "com.amazonaws.sqs#RequestThrottled":
1096
- throw await de_RequestThrottledRes(parsedOutput, context);
1097
- case "UnsupportedOperation":
1098
- case "com.amazonaws.sqs#UnsupportedOperation":
1099
- throw await de_UnsupportedOperationRes(parsedOutput, context);
1100
- default:
1101
- const parsedBody = parsedOutput.body;
1102
- return throwDefaultError({
1103
- output,
1104
- parsedBody,
1105
- errorCode,
1106
- });
1107
- }
1108
- };
1109
- const de_BatchEntryIdsNotDistinctRes = async (parsedOutput, context) => {
1110
- const body = parsedOutput.body;
1111
- const deserialized = _json(body);
1112
- const exception = new BatchEntryIdsNotDistinct({
1113
- $metadata: deserializeMetadata(parsedOutput),
1114
- ...deserialized,
1115
- });
1116
- return __decorateServiceException(exception, body);
1117
- };
1118
- const de_BatchRequestTooLongRes = async (parsedOutput, context) => {
1119
- const body = parsedOutput.body;
1120
- const deserialized = _json(body);
1121
- const exception = new BatchRequestTooLong({
1122
- $metadata: deserializeMetadata(parsedOutput),
1123
- ...deserialized,
1124
- });
1125
- return __decorateServiceException(exception, body);
1126
- };
1127
- const de_EmptyBatchRequestRes = async (parsedOutput, context) => {
1128
- const body = parsedOutput.body;
1129
- const deserialized = _json(body);
1130
- const exception = new EmptyBatchRequest({
1131
- $metadata: deserializeMetadata(parsedOutput),
1132
- ...deserialized,
1133
- });
1134
- return __decorateServiceException(exception, body);
1135
- };
1136
- const de_InvalidAddressRes = async (parsedOutput, context) => {
1137
- const body = parsedOutput.body;
1138
- const deserialized = _json(body);
1139
- const exception = new InvalidAddress({
1140
- $metadata: deserializeMetadata(parsedOutput),
1141
- ...deserialized,
1142
- });
1143
- return __decorateServiceException(exception, body);
1144
- };
1145
- const de_InvalidAttributeNameRes = async (parsedOutput, context) => {
1146
- const body = parsedOutput.body;
1147
- const deserialized = _json(body);
1148
- const exception = new InvalidAttributeName({
1149
- $metadata: deserializeMetadata(parsedOutput),
1150
- ...deserialized,
1151
- });
1152
- return __decorateServiceException(exception, body);
1153
- };
1154
- const de_InvalidAttributeValueRes = async (parsedOutput, context) => {
1155
- const body = parsedOutput.body;
1156
- const deserialized = _json(body);
1157
- const exception = new InvalidAttributeValue({
1158
- $metadata: deserializeMetadata(parsedOutput),
1159
- ...deserialized,
1160
- });
1161
- return __decorateServiceException(exception, body);
1162
- };
1163
- const de_InvalidBatchEntryIdRes = async (parsedOutput, context) => {
1164
- const body = parsedOutput.body;
1165
- const deserialized = _json(body);
1166
- const exception = new InvalidBatchEntryId({
1167
- $metadata: deserializeMetadata(parsedOutput),
1168
- ...deserialized,
1169
- });
1170
- return __decorateServiceException(exception, body);
1171
- };
1172
- const de_InvalidIdFormatRes = async (parsedOutput, context) => {
1173
- const body = parsedOutput.body;
1174
- const deserialized = _json(body);
1175
- const exception = new InvalidIdFormat({
1176
- $metadata: deserializeMetadata(parsedOutput),
1177
- ...deserialized,
1178
- });
1179
- return __decorateServiceException(exception, body);
1180
- };
1181
- const de_InvalidMessageContentsRes = async (parsedOutput, context) => {
1182
- const body = parsedOutput.body;
1183
- const deserialized = _json(body);
1184
- const exception = new InvalidMessageContents({
1185
- $metadata: deserializeMetadata(parsedOutput),
1186
- ...deserialized,
1187
- });
1188
- return __decorateServiceException(exception, body);
1189
- };
1190
- const de_InvalidSecurityRes = async (parsedOutput, context) => {
1191
- const body = parsedOutput.body;
1192
- const deserialized = _json(body);
1193
- const exception = new InvalidSecurity({
1194
- $metadata: deserializeMetadata(parsedOutput),
1195
- ...deserialized,
1196
- });
1197
- return __decorateServiceException(exception, body);
1198
- };
1199
- const de_KmsAccessDeniedRes = async (parsedOutput, context) => {
1200
- const body = parsedOutput.body;
1201
- const deserialized = _json(body);
1202
- const exception = new KmsAccessDenied({
1203
- $metadata: deserializeMetadata(parsedOutput),
1204
- ...deserialized,
1205
- });
1206
- return __decorateServiceException(exception, body);
1207
- };
1208
- const de_KmsDisabledRes = async (parsedOutput, context) => {
1209
- const body = parsedOutput.body;
1210
- const deserialized = _json(body);
1211
- const exception = new KmsDisabled({
1212
- $metadata: deserializeMetadata(parsedOutput),
1213
- ...deserialized,
1214
- });
1215
- return __decorateServiceException(exception, body);
1216
- };
1217
- const de_KmsInvalidKeyUsageRes = async (parsedOutput, context) => {
1218
- const body = parsedOutput.body;
1219
- const deserialized = _json(body);
1220
- const exception = new KmsInvalidKeyUsage({
1221
- $metadata: deserializeMetadata(parsedOutput),
1222
- ...deserialized,
1223
- });
1224
- return __decorateServiceException(exception, body);
1225
- };
1226
- const de_KmsInvalidStateRes = async (parsedOutput, context) => {
1227
- const body = parsedOutput.body;
1228
- const deserialized = _json(body);
1229
- const exception = new KmsInvalidState({
1230
- $metadata: deserializeMetadata(parsedOutput),
1231
- ...deserialized,
1232
- });
1233
- return __decorateServiceException(exception, body);
1234
- };
1235
- const de_KmsNotFoundRes = async (parsedOutput, context) => {
1236
- const body = parsedOutput.body;
1237
- const deserialized = _json(body);
1238
- const exception = new KmsNotFound({
1239
- $metadata: deserializeMetadata(parsedOutput),
1240
- ...deserialized,
1241
- });
1242
- return __decorateServiceException(exception, body);
1243
- };
1244
- const de_KmsOptInRequiredRes = async (parsedOutput, context) => {
1245
- const body = parsedOutput.body;
1246
- const deserialized = _json(body);
1247
- const exception = new KmsOptInRequired({
1248
- $metadata: deserializeMetadata(parsedOutput),
1249
- ...deserialized,
1250
- });
1251
- return __decorateServiceException(exception, body);
1252
- };
1253
- const de_KmsThrottledRes = async (parsedOutput, context) => {
1254
- const body = parsedOutput.body;
1255
- const deserialized = _json(body);
1256
- const exception = new KmsThrottled({
1257
- $metadata: deserializeMetadata(parsedOutput),
1258
- ...deserialized,
1259
- });
1260
- return __decorateServiceException(exception, body);
1261
- };
1262
- const de_MessageNotInflightRes = async (parsedOutput, context) => {
1263
- const body = parsedOutput.body;
1264
- const deserialized = _json(body);
1265
- const exception = new MessageNotInflight({
1266
- $metadata: deserializeMetadata(parsedOutput),
1267
- ...deserialized,
1268
- });
1269
- return __decorateServiceException(exception, body);
1270
- };
1271
- const de_OverLimitRes = async (parsedOutput, context) => {
1272
- const body = parsedOutput.body;
1273
- const deserialized = _json(body);
1274
- const exception = new OverLimit({
1275
- $metadata: deserializeMetadata(parsedOutput),
1276
- ...deserialized,
1277
- });
1278
- return __decorateServiceException(exception, body);
1279
- };
1280
- const de_PurgeQueueInProgressRes = async (parsedOutput, context) => {
1281
- const body = parsedOutput.body;
1282
- const deserialized = _json(body);
1283
- const exception = new PurgeQueueInProgress({
1284
- $metadata: deserializeMetadata(parsedOutput),
1285
- ...deserialized,
1286
- });
1287
- return __decorateServiceException(exception, body);
1288
- };
1289
- const de_QueueDeletedRecentlyRes = async (parsedOutput, context) => {
1290
- const body = parsedOutput.body;
1291
- const deserialized = _json(body);
1292
- const exception = new QueueDeletedRecently({
1293
- $metadata: deserializeMetadata(parsedOutput),
1294
- ...deserialized,
1295
- });
1296
- return __decorateServiceException(exception, body);
1297
- };
1298
- const de_QueueDoesNotExistRes = async (parsedOutput, context) => {
1299
- const body = parsedOutput.body;
1300
- const deserialized = _json(body);
1301
- const exception = new QueueDoesNotExist({
1302
- $metadata: deserializeMetadata(parsedOutput),
1303
- ...deserialized,
1304
- });
1305
- return __decorateServiceException(exception, body);
1306
- };
1307
- const de_QueueNameExistsRes = async (parsedOutput, context) => {
1308
- const body = parsedOutput.body;
1309
- const deserialized = _json(body);
1310
- const exception = new QueueNameExists({
1311
- $metadata: deserializeMetadata(parsedOutput),
1312
- ...deserialized,
1313
- });
1314
- return __decorateServiceException(exception, body);
1315
- };
1316
- const de_ReceiptHandleIsInvalidRes = async (parsedOutput, context) => {
1317
- const body = parsedOutput.body;
1318
- const deserialized = _json(body);
1319
- const exception = new ReceiptHandleIsInvalid({
1320
- $metadata: deserializeMetadata(parsedOutput),
1321
- ...deserialized,
1322
- });
1323
- return __decorateServiceException(exception, body);
1324
- };
1325
- const de_RequestThrottledRes = async (parsedOutput, context) => {
1326
- const body = parsedOutput.body;
1327
- const deserialized = _json(body);
1328
- const exception = new RequestThrottled({
1329
- $metadata: deserializeMetadata(parsedOutput),
1330
- ...deserialized,
1331
- });
1332
- return __decorateServiceException(exception, body);
1333
- };
1334
- const de_TooManyEntriesInBatchRequestRes = async (parsedOutput, context) => {
1335
- const body = parsedOutput.body;
1336
- const deserialized = _json(body);
1337
- const exception = new TooManyEntriesInBatchRequest({
1338
- $metadata: deserializeMetadata(parsedOutput),
1339
- ...deserialized,
1340
- });
1341
- return __decorateServiceException(exception, body);
1342
- };
1343
- const de_UnsupportedOperationRes = async (parsedOutput, context) => {
1344
- const body = parsedOutput.body;
1345
- const deserialized = _json(body);
1346
- const exception = new UnsupportedOperation({
1347
- $metadata: deserializeMetadata(parsedOutput),
1348
- ...deserialized,
1349
- });
1350
- return __decorateServiceException(exception, body);
1351
- };
1352
- const se_BinaryList = (input, context) => {
1353
- return input
1354
- .filter((e) => e != null)
1355
- .map((entry) => {
1356
- return context.base64Encoder(entry);
1357
- });
1358
- };
1359
- const se_MessageAttributeValue = (input, context) => {
1360
- return take(input, {
1361
- BinaryListValues: (_) => se_BinaryList(_, context),
1362
- BinaryValue: context.base64Encoder,
1363
- DataType: [],
1364
- StringListValues: _json,
1365
- StringValue: [],
1366
- });
1367
- };
1368
- const se_MessageBodyAttributeMap = (input, context) => {
1369
- return Object.entries(input).reduce((acc, [key, value]) => {
1370
- if (value === null) {
1371
- return acc;
1372
- }
1373
- acc[key] = se_MessageAttributeValue(value, context);
1374
- return acc;
1375
- }, {});
1376
- };
1377
- const se_MessageBodySystemAttributeMap = (input, context) => {
1378
- return Object.entries(input).reduce((acc, [key, value]) => {
1379
- if (value === null) {
1380
- return acc;
1381
- }
1382
- acc[key] = se_MessageSystemAttributeValue(value, context);
1383
- return acc;
1384
- }, {});
1385
- };
1386
- const se_MessageSystemAttributeValue = (input, context) => {
1387
- return take(input, {
1388
- BinaryListValues: (_) => se_BinaryList(_, context),
1389
- BinaryValue: context.base64Encoder,
1390
- DataType: [],
1391
- StringListValues: _json,
1392
- StringValue: [],
1393
- });
1394
- };
1395
- const se_SendMessageBatchRequest = (input, context) => {
1396
- return take(input, {
1397
- Entries: (_) => se_SendMessageBatchRequestEntryList(_, context),
1398
- QueueUrl: [],
1399
- });
1400
- };
1401
- const se_SendMessageBatchRequestEntry = (input, context) => {
1402
- return take(input, {
1403
- DelaySeconds: [],
1404
- Id: [],
1405
- MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1406
- MessageBody: [],
1407
- MessageDeduplicationId: [],
1408
- MessageGroupId: [],
1409
- MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context),
1410
- });
1411
- };
1412
- const se_SendMessageBatchRequestEntryList = (input, context) => {
1413
- return input
1414
- .filter((e) => e != null)
1415
- .map((entry) => {
1416
- return se_SendMessageBatchRequestEntry(entry, context);
1417
- });
1418
- };
1419
- const se_SendMessageRequest = (input, context) => {
1420
- return take(input, {
1421
- DelaySeconds: [],
1422
- MessageAttributes: (_) => se_MessageBodyAttributeMap(_, context),
1423
- MessageBody: [],
1424
- MessageDeduplicationId: [],
1425
- MessageGroupId: [],
1426
- MessageSystemAttributes: (_) => se_MessageBodySystemAttributeMap(_, context),
1427
- QueueUrl: [],
1428
- });
1429
- };
1430
- const de_BinaryList = (output, context) => {
1431
- const retVal = (output || [])
1432
- .filter((e) => e != null)
1433
- .map((entry) => {
1434
- return context.base64Decoder(entry);
1435
- });
1436
- return retVal;
1437
- };
1438
- const de_Message = (output, context) => {
1439
- return take(output, {
1440
- Attributes: _json,
1441
- Body: __expectString,
1442
- MD5OfBody: __expectString,
1443
- MD5OfMessageAttributes: __expectString,
1444
- MessageAttributes: (_) => de_MessageBodyAttributeMap(_, context),
1445
- MessageId: __expectString,
1446
- ReceiptHandle: __expectString,
1447
- });
1448
- };
1449
- const de_MessageAttributeValue = (output, context) => {
1450
- return take(output, {
1451
- BinaryListValues: (_) => de_BinaryList(_, context),
1452
- BinaryValue: context.base64Decoder,
1453
- DataType: __expectString,
1454
- StringListValues: _json,
1455
- StringValue: __expectString,
1456
- });
1457
- };
1458
- const de_MessageBodyAttributeMap = (output, context) => {
1459
- return Object.entries(output).reduce((acc, [key, value]) => {
1460
- if (value === null) {
1461
- return acc;
1462
- }
1463
- acc[key] = de_MessageAttributeValue(value, context);
1464
- return acc;
1465
- }, {});
1466
- };
1467
- const de_MessageList = (output, context) => {
1468
- const retVal = (output || [])
1469
- .filter((e) => e != null)
1470
- .map((entry) => {
1471
- return de_Message(entry, context);
1472
- });
1473
- return retVal;
1474
- };
1475
- const de_ReceiveMessageResult = (output, context) => {
1476
- return take(output, {
1477
- Messages: (_) => de_MessageList(_, context),
1478
- });
1479
- };
1480
- const deserializeMetadata = (output) => ({
1481
- httpStatusCode: output.statusCode,
1482
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1483
- extendedRequestId: output.headers["x-amz-id-2"],
1484
- cfId: output.headers["x-amz-cf-id"],
1485
- });
1486
- const collectBody = (streamBody = new Uint8Array(), context) => {
1487
- if (streamBody instanceof Uint8Array) {
1488
- return Promise.resolve(streamBody);
1489
- }
1490
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1491
- };
1492
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1493
- const throwDefaultError = withBaseException(__BaseException);
1494
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1495
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1496
- const contents = {
1497
- protocol,
1498
- hostname,
1499
- port,
1500
- method: "POST",
1501
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1502
- headers,
1503
- };
1504
- if (resolvedHostname !== undefined) {
1505
- contents.hostname = resolvedHostname;
1506
- }
1507
- if (body !== undefined) {
1508
- contents.body = body;
1509
- }
1510
- return new __HttpRequest(contents);
1511
- };
1512
- function sharedHeaders(operation) {
1513
- return {
1514
- "content-type": "application/x-amz-json-1.0",
1515
- "x-amz-target": `AmazonSQS.${operation}`,
1516
- };
1517
- }
1518
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1519
- if (encoded.length) {
1520
- return JSON.parse(encoded);
1521
- }
1522
- return {};
1523
- });
1524
- const parseErrorBody = async (errorBody, context) => {
1525
- const value = await parseBody(errorBody, context);
1526
- value.message = value.message ?? value.Message;
1527
- return value;
1528
- };
1529
- const loadRestJsonErrorCode = (output, data) => {
1530
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1531
- const sanitizeErrorCode = (rawValue) => {
1532
- let cleanValue = rawValue;
1533
- if (typeof cleanValue === "number") {
1534
- cleanValue = cleanValue.toString();
1535
- }
1536
- if (cleanValue.indexOf(",") >= 0) {
1537
- cleanValue = cleanValue.split(",")[0];
1538
- }
1539
- if (cleanValue.indexOf(":") >= 0) {
1540
- cleanValue = cleanValue.split(":")[0];
1541
- }
1542
- if (cleanValue.indexOf("#") >= 0) {
1543
- cleanValue = cleanValue.split("#")[1];
1544
- }
1545
- return cleanValue;
1546
- };
1547
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1548
- if (headerKey !== undefined) {
1549
- return sanitizeErrorCode(output.headers[headerKey]);
1550
- }
1551
- if (data.code !== undefined) {
1552
- return sanitizeErrorCode(data.code);
1553
- }
1554
- if (data["__type"] !== undefined) {
1555
- return sanitizeErrorCode(data["__type"]);
1556
- }
1557
- };
1558
- const populateBodyWithQueryCompatibility = (parsedOutput, headers) => {
1559
- const queryErrorHeader = headers["x-amzn-query-error"];
1560
- if (parsedOutput.body !== undefined && queryErrorHeader != null) {
1561
- const codeAndType = queryErrorHeader.split(";");
1562
- parsedOutput.body.Code = codeAndType[0];
1563
- parsedOutput.body.Type = codeAndType[1];
1564
- }
1565
- };