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