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