@aws-sdk/client-sqs 3.310.0 → 3.315.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.
@@ -7,9 +7,7 @@ const fast_xml_parser_1 = require("fast-xml-parser");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const SQSServiceException_1 = require("../models/SQSServiceException");
9
9
  const se_AddPermissionCommand = async (input, context) => {
10
- const headers = {
11
- "content-type": "application/x-www-form-urlencoded",
12
- };
10
+ const headers = SHARED_HEADERS;
13
11
  let body;
14
12
  body = buildFormUrlencodedString({
15
13
  ...se_AddPermissionRequest(input, context),
@@ -20,9 +18,7 @@ const se_AddPermissionCommand = async (input, context) => {
20
18
  };
21
19
  exports.se_AddPermissionCommand = se_AddPermissionCommand;
22
20
  const se_ChangeMessageVisibilityCommand = async (input, context) => {
23
- const headers = {
24
- "content-type": "application/x-www-form-urlencoded",
25
- };
21
+ const headers = SHARED_HEADERS;
26
22
  let body;
27
23
  body = buildFormUrlencodedString({
28
24
  ...se_ChangeMessageVisibilityRequest(input, context),
@@ -33,9 +29,7 @@ const se_ChangeMessageVisibilityCommand = async (input, context) => {
33
29
  };
34
30
  exports.se_ChangeMessageVisibilityCommand = se_ChangeMessageVisibilityCommand;
35
31
  const se_ChangeMessageVisibilityBatchCommand = async (input, context) => {
36
- const headers = {
37
- "content-type": "application/x-www-form-urlencoded",
38
- };
32
+ const headers = SHARED_HEADERS;
39
33
  let body;
40
34
  body = buildFormUrlencodedString({
41
35
  ...se_ChangeMessageVisibilityBatchRequest(input, context),
@@ -46,9 +40,7 @@ const se_ChangeMessageVisibilityBatchCommand = async (input, context) => {
46
40
  };
47
41
  exports.se_ChangeMessageVisibilityBatchCommand = se_ChangeMessageVisibilityBatchCommand;
48
42
  const se_CreateQueueCommand = async (input, context) => {
49
- const headers = {
50
- "content-type": "application/x-www-form-urlencoded",
51
- };
43
+ const headers = SHARED_HEADERS;
52
44
  let body;
53
45
  body = buildFormUrlencodedString({
54
46
  ...se_CreateQueueRequest(input, context),
@@ -59,9 +51,7 @@ const se_CreateQueueCommand = async (input, context) => {
59
51
  };
60
52
  exports.se_CreateQueueCommand = se_CreateQueueCommand;
61
53
  const se_DeleteMessageCommand = async (input, context) => {
62
- const headers = {
63
- "content-type": "application/x-www-form-urlencoded",
64
- };
54
+ const headers = SHARED_HEADERS;
65
55
  let body;
66
56
  body = buildFormUrlencodedString({
67
57
  ...se_DeleteMessageRequest(input, context),
@@ -72,9 +62,7 @@ const se_DeleteMessageCommand = async (input, context) => {
72
62
  };
73
63
  exports.se_DeleteMessageCommand = se_DeleteMessageCommand;
74
64
  const se_DeleteMessageBatchCommand = async (input, context) => {
75
- const headers = {
76
- "content-type": "application/x-www-form-urlencoded",
77
- };
65
+ const headers = SHARED_HEADERS;
78
66
  let body;
79
67
  body = buildFormUrlencodedString({
80
68
  ...se_DeleteMessageBatchRequest(input, context),
@@ -85,9 +73,7 @@ const se_DeleteMessageBatchCommand = async (input, context) => {
85
73
  };
86
74
  exports.se_DeleteMessageBatchCommand = se_DeleteMessageBatchCommand;
87
75
  const se_DeleteQueueCommand = async (input, context) => {
88
- const headers = {
89
- "content-type": "application/x-www-form-urlencoded",
90
- };
76
+ const headers = SHARED_HEADERS;
91
77
  let body;
92
78
  body = buildFormUrlencodedString({
93
79
  ...se_DeleteQueueRequest(input, context),
@@ -98,9 +84,7 @@ const se_DeleteQueueCommand = async (input, context) => {
98
84
  };
99
85
  exports.se_DeleteQueueCommand = se_DeleteQueueCommand;
100
86
  const se_GetQueueAttributesCommand = async (input, context) => {
101
- const headers = {
102
- "content-type": "application/x-www-form-urlencoded",
103
- };
87
+ const headers = SHARED_HEADERS;
104
88
  let body;
105
89
  body = buildFormUrlencodedString({
106
90
  ...se_GetQueueAttributesRequest(input, context),
@@ -111,9 +95,7 @@ const se_GetQueueAttributesCommand = async (input, context) => {
111
95
  };
112
96
  exports.se_GetQueueAttributesCommand = se_GetQueueAttributesCommand;
113
97
  const se_GetQueueUrlCommand = async (input, context) => {
114
- const headers = {
115
- "content-type": "application/x-www-form-urlencoded",
116
- };
98
+ const headers = SHARED_HEADERS;
117
99
  let body;
118
100
  body = buildFormUrlencodedString({
119
101
  ...se_GetQueueUrlRequest(input, context),
@@ -124,9 +106,7 @@ const se_GetQueueUrlCommand = async (input, context) => {
124
106
  };
125
107
  exports.se_GetQueueUrlCommand = se_GetQueueUrlCommand;
126
108
  const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
127
- const headers = {
128
- "content-type": "application/x-www-form-urlencoded",
129
- };
109
+ const headers = SHARED_HEADERS;
130
110
  let body;
131
111
  body = buildFormUrlencodedString({
132
112
  ...se_ListDeadLetterSourceQueuesRequest(input, context),
@@ -137,9 +117,7 @@ const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
137
117
  };
138
118
  exports.se_ListDeadLetterSourceQueuesCommand = se_ListDeadLetterSourceQueuesCommand;
139
119
  const se_ListQueuesCommand = async (input, context) => {
140
- const headers = {
141
- "content-type": "application/x-www-form-urlencoded",
142
- };
120
+ const headers = SHARED_HEADERS;
143
121
  let body;
144
122
  body = buildFormUrlencodedString({
145
123
  ...se_ListQueuesRequest(input, context),
@@ -150,9 +128,7 @@ const se_ListQueuesCommand = async (input, context) => {
150
128
  };
151
129
  exports.se_ListQueuesCommand = se_ListQueuesCommand;
152
130
  const se_ListQueueTagsCommand = async (input, context) => {
153
- const headers = {
154
- "content-type": "application/x-www-form-urlencoded",
155
- };
131
+ const headers = SHARED_HEADERS;
156
132
  let body;
157
133
  body = buildFormUrlencodedString({
158
134
  ...se_ListQueueTagsRequest(input, context),
@@ -163,9 +139,7 @@ const se_ListQueueTagsCommand = async (input, context) => {
163
139
  };
164
140
  exports.se_ListQueueTagsCommand = se_ListQueueTagsCommand;
165
141
  const se_PurgeQueueCommand = async (input, context) => {
166
- const headers = {
167
- "content-type": "application/x-www-form-urlencoded",
168
- };
142
+ const headers = SHARED_HEADERS;
169
143
  let body;
170
144
  body = buildFormUrlencodedString({
171
145
  ...se_PurgeQueueRequest(input, context),
@@ -176,9 +150,7 @@ const se_PurgeQueueCommand = async (input, context) => {
176
150
  };
177
151
  exports.se_PurgeQueueCommand = se_PurgeQueueCommand;
178
152
  const se_ReceiveMessageCommand = async (input, context) => {
179
- const headers = {
180
- "content-type": "application/x-www-form-urlencoded",
181
- };
153
+ const headers = SHARED_HEADERS;
182
154
  let body;
183
155
  body = buildFormUrlencodedString({
184
156
  ...se_ReceiveMessageRequest(input, context),
@@ -189,9 +161,7 @@ const se_ReceiveMessageCommand = async (input, context) => {
189
161
  };
190
162
  exports.se_ReceiveMessageCommand = se_ReceiveMessageCommand;
191
163
  const se_RemovePermissionCommand = async (input, context) => {
192
- const headers = {
193
- "content-type": "application/x-www-form-urlencoded",
194
- };
164
+ const headers = SHARED_HEADERS;
195
165
  let body;
196
166
  body = buildFormUrlencodedString({
197
167
  ...se_RemovePermissionRequest(input, context),
@@ -202,9 +172,7 @@ const se_RemovePermissionCommand = async (input, context) => {
202
172
  };
203
173
  exports.se_RemovePermissionCommand = se_RemovePermissionCommand;
204
174
  const se_SendMessageCommand = async (input, context) => {
205
- const headers = {
206
- "content-type": "application/x-www-form-urlencoded",
207
- };
175
+ const headers = SHARED_HEADERS;
208
176
  let body;
209
177
  body = buildFormUrlencodedString({
210
178
  ...se_SendMessageRequest(input, context),
@@ -215,9 +183,7 @@ const se_SendMessageCommand = async (input, context) => {
215
183
  };
216
184
  exports.se_SendMessageCommand = se_SendMessageCommand;
217
185
  const se_SendMessageBatchCommand = async (input, context) => {
218
- const headers = {
219
- "content-type": "application/x-www-form-urlencoded",
220
- };
186
+ const headers = SHARED_HEADERS;
221
187
  let body;
222
188
  body = buildFormUrlencodedString({
223
189
  ...se_SendMessageBatchRequest(input, context),
@@ -228,9 +194,7 @@ const se_SendMessageBatchCommand = async (input, context) => {
228
194
  };
229
195
  exports.se_SendMessageBatchCommand = se_SendMessageBatchCommand;
230
196
  const se_SetQueueAttributesCommand = async (input, context) => {
231
- const headers = {
232
- "content-type": "application/x-www-form-urlencoded",
233
- };
197
+ const headers = SHARED_HEADERS;
234
198
  let body;
235
199
  body = buildFormUrlencodedString({
236
200
  ...se_SetQueueAttributesRequest(input, context),
@@ -241,9 +205,7 @@ const se_SetQueueAttributesCommand = async (input, context) => {
241
205
  };
242
206
  exports.se_SetQueueAttributesCommand = se_SetQueueAttributesCommand;
243
207
  const se_TagQueueCommand = async (input, context) => {
244
- const headers = {
245
- "content-type": "application/x-www-form-urlencoded",
246
- };
208
+ const headers = SHARED_HEADERS;
247
209
  let body;
248
210
  body = buildFormUrlencodedString({
249
211
  ...se_TagQueueRequest(input, context),
@@ -254,9 +216,7 @@ const se_TagQueueCommand = async (input, context) => {
254
216
  };
255
217
  exports.se_TagQueueCommand = se_TagQueueCommand;
256
218
  const se_UntagQueueCommand = async (input, context) => {
257
- const headers = {
258
- "content-type": "application/x-www-form-urlencoded",
259
- };
219
+ const headers = SHARED_HEADERS;
260
220
  let body;
261
221
  body = buildFormUrlencodedString({
262
222
  ...se_UntagQueueRequest(input, context),
@@ -274,7 +234,7 @@ const de_AddPermissionCommand = async (output, context) => {
274
234
  const response = {
275
235
  $metadata: deserializeMetadata(output),
276
236
  };
277
- return Promise.resolve(response);
237
+ return response;
278
238
  };
279
239
  exports.de_AddPermissionCommand = de_AddPermissionCommand;
280
240
  const de_AddPermissionCommandError = async (output, context) => {
@@ -289,10 +249,9 @@ const de_AddPermissionCommandError = async (output, context) => {
289
249
  throw await de_OverLimitRes(parsedOutput, context);
290
250
  default:
291
251
  const parsedBody = parsedOutput.body;
292
- (0, smithy_client_1.throwDefaultError)({
252
+ return throwDefaultError({
293
253
  output,
294
254
  parsedBody: parsedBody.Error,
295
- exceptionCtor: SQSServiceException_1.SQSServiceException,
296
255
  errorCode,
297
256
  });
298
257
  }
@@ -305,7 +264,7 @@ const de_ChangeMessageVisibilityCommand = async (output, context) => {
305
264
  const response = {
306
265
  $metadata: deserializeMetadata(output),
307
266
  };
308
- return Promise.resolve(response);
267
+ return response;
309
268
  };
310
269
  exports.de_ChangeMessageVisibilityCommand = de_ChangeMessageVisibilityCommand;
311
270
  const de_ChangeMessageVisibilityCommandError = async (output, context) => {
@@ -323,10 +282,9 @@ const de_ChangeMessageVisibilityCommandError = async (output, context) => {
323
282
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
324
283
  default:
325
284
  const parsedBody = parsedOutput.body;
326
- (0, smithy_client_1.throwDefaultError)({
285
+ return throwDefaultError({
327
286
  output,
328
287
  parsedBody: parsedBody.Error,
329
- exceptionCtor: SQSServiceException_1.SQSServiceException,
330
288
  errorCode,
331
289
  });
332
290
  }
@@ -342,7 +300,7 @@ const de_ChangeMessageVisibilityBatchCommand = async (output, context) => {
342
300
  $metadata: deserializeMetadata(output),
343
301
  ...contents,
344
302
  };
345
- return Promise.resolve(response);
303
+ return response;
346
304
  };
347
305
  exports.de_ChangeMessageVisibilityBatchCommand = de_ChangeMessageVisibilityBatchCommand;
348
306
  const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
@@ -366,10 +324,9 @@ const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
366
324
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
367
325
  default:
368
326
  const parsedBody = parsedOutput.body;
369
- (0, smithy_client_1.throwDefaultError)({
327
+ return throwDefaultError({
370
328
  output,
371
329
  parsedBody: parsedBody.Error,
372
- exceptionCtor: SQSServiceException_1.SQSServiceException,
373
330
  errorCode,
374
331
  });
375
332
  }
@@ -385,7 +342,7 @@ const de_CreateQueueCommand = async (output, context) => {
385
342
  $metadata: deserializeMetadata(output),
386
343
  ...contents,
387
344
  };
388
- return Promise.resolve(response);
345
+ return response;
389
346
  };
390
347
  exports.de_CreateQueueCommand = de_CreateQueueCommand;
391
348
  const de_CreateQueueCommandError = async (output, context) => {
@@ -403,10 +360,9 @@ const de_CreateQueueCommandError = async (output, context) => {
403
360
  throw await de_QueueNameExistsRes(parsedOutput, context);
404
361
  default:
405
362
  const parsedBody = parsedOutput.body;
406
- (0, smithy_client_1.throwDefaultError)({
363
+ return throwDefaultError({
407
364
  output,
408
365
  parsedBody: parsedBody.Error,
409
- exceptionCtor: SQSServiceException_1.SQSServiceException,
410
366
  errorCode,
411
367
  });
412
368
  }
@@ -419,7 +375,7 @@ const de_DeleteMessageCommand = async (output, context) => {
419
375
  const response = {
420
376
  $metadata: deserializeMetadata(output),
421
377
  };
422
- return Promise.resolve(response);
378
+ return response;
423
379
  };
424
380
  exports.de_DeleteMessageCommand = de_DeleteMessageCommand;
425
381
  const de_DeleteMessageCommandError = async (output, context) => {
@@ -437,10 +393,9 @@ const de_DeleteMessageCommandError = async (output, context) => {
437
393
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
438
394
  default:
439
395
  const parsedBody = parsedOutput.body;
440
- (0, smithy_client_1.throwDefaultError)({
396
+ return throwDefaultError({
441
397
  output,
442
398
  parsedBody: parsedBody.Error,
443
- exceptionCtor: SQSServiceException_1.SQSServiceException,
444
399
  errorCode,
445
400
  });
446
401
  }
@@ -456,7 +411,7 @@ const de_DeleteMessageBatchCommand = async (output, context) => {
456
411
  $metadata: deserializeMetadata(output),
457
412
  ...contents,
458
413
  };
459
- return Promise.resolve(response);
414
+ return response;
460
415
  };
461
416
  exports.de_DeleteMessageBatchCommand = de_DeleteMessageBatchCommand;
462
417
  const de_DeleteMessageBatchCommandError = async (output, context) => {
@@ -480,10 +435,9 @@ const de_DeleteMessageBatchCommandError = async (output, context) => {
480
435
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
481
436
  default:
482
437
  const parsedBody = parsedOutput.body;
483
- (0, smithy_client_1.throwDefaultError)({
438
+ return throwDefaultError({
484
439
  output,
485
440
  parsedBody: parsedBody.Error,
486
- exceptionCtor: SQSServiceException_1.SQSServiceException,
487
441
  errorCode,
488
442
  });
489
443
  }
@@ -496,7 +450,7 @@ const de_DeleteQueueCommand = async (output, context) => {
496
450
  const response = {
497
451
  $metadata: deserializeMetadata(output),
498
452
  };
499
- return Promise.resolve(response);
453
+ return response;
500
454
  };
501
455
  exports.de_DeleteQueueCommand = de_DeleteQueueCommand;
502
456
  const de_DeleteQueueCommandError = async (output, context) => {
@@ -506,10 +460,9 @@ const de_DeleteQueueCommandError = async (output, context) => {
506
460
  };
507
461
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
508
462
  const parsedBody = parsedOutput.body;
509
- (0, smithy_client_1.throwDefaultError)({
463
+ return throwDefaultError({
510
464
  output,
511
465
  parsedBody: parsedBody.Error,
512
- exceptionCtor: SQSServiceException_1.SQSServiceException,
513
466
  errorCode,
514
467
  });
515
468
  };
@@ -524,7 +477,7 @@ const de_GetQueueAttributesCommand = async (output, context) => {
524
477
  $metadata: deserializeMetadata(output),
525
478
  ...contents,
526
479
  };
527
- return Promise.resolve(response);
480
+ return response;
528
481
  };
529
482
  exports.de_GetQueueAttributesCommand = de_GetQueueAttributesCommand;
530
483
  const de_GetQueueAttributesCommandError = async (output, context) => {
@@ -539,10 +492,9 @@ const de_GetQueueAttributesCommandError = async (output, context) => {
539
492
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
540
493
  default:
541
494
  const parsedBody = parsedOutput.body;
542
- (0, smithy_client_1.throwDefaultError)({
495
+ return throwDefaultError({
543
496
  output,
544
497
  parsedBody: parsedBody.Error,
545
- exceptionCtor: SQSServiceException_1.SQSServiceException,
546
498
  errorCode,
547
499
  });
548
500
  }
@@ -558,7 +510,7 @@ const de_GetQueueUrlCommand = async (output, context) => {
558
510
  $metadata: deserializeMetadata(output),
559
511
  ...contents,
560
512
  };
561
- return Promise.resolve(response);
513
+ return response;
562
514
  };
563
515
  exports.de_GetQueueUrlCommand = de_GetQueueUrlCommand;
564
516
  const de_GetQueueUrlCommandError = async (output, context) => {
@@ -573,10 +525,9 @@ const de_GetQueueUrlCommandError = async (output, context) => {
573
525
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
574
526
  default:
575
527
  const parsedBody = parsedOutput.body;
576
- (0, smithy_client_1.throwDefaultError)({
528
+ return throwDefaultError({
577
529
  output,
578
530
  parsedBody: parsedBody.Error,
579
- exceptionCtor: SQSServiceException_1.SQSServiceException,
580
531
  errorCode,
581
532
  });
582
533
  }
@@ -592,7 +543,7 @@ const de_ListDeadLetterSourceQueuesCommand = async (output, context) => {
592
543
  $metadata: deserializeMetadata(output),
593
544
  ...contents,
594
545
  };
595
- return Promise.resolve(response);
546
+ return response;
596
547
  };
597
548
  exports.de_ListDeadLetterSourceQueuesCommand = de_ListDeadLetterSourceQueuesCommand;
598
549
  const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
@@ -607,10 +558,9 @@ const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
607
558
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
608
559
  default:
609
560
  const parsedBody = parsedOutput.body;
610
- (0, smithy_client_1.throwDefaultError)({
561
+ return throwDefaultError({
611
562
  output,
612
563
  parsedBody: parsedBody.Error,
613
- exceptionCtor: SQSServiceException_1.SQSServiceException,
614
564
  errorCode,
615
565
  });
616
566
  }
@@ -626,7 +576,7 @@ const de_ListQueuesCommand = async (output, context) => {
626
576
  $metadata: deserializeMetadata(output),
627
577
  ...contents,
628
578
  };
629
- return Promise.resolve(response);
579
+ return response;
630
580
  };
631
581
  exports.de_ListQueuesCommand = de_ListQueuesCommand;
632
582
  const de_ListQueuesCommandError = async (output, context) => {
@@ -636,10 +586,9 @@ const de_ListQueuesCommandError = async (output, context) => {
636
586
  };
637
587
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
638
588
  const parsedBody = parsedOutput.body;
639
- (0, smithy_client_1.throwDefaultError)({
589
+ return throwDefaultError({
640
590
  output,
641
591
  parsedBody: parsedBody.Error,
642
- exceptionCtor: SQSServiceException_1.SQSServiceException,
643
592
  errorCode,
644
593
  });
645
594
  };
@@ -654,7 +603,7 @@ const de_ListQueueTagsCommand = async (output, context) => {
654
603
  $metadata: deserializeMetadata(output),
655
604
  ...contents,
656
605
  };
657
- return Promise.resolve(response);
606
+ return response;
658
607
  };
659
608
  exports.de_ListQueueTagsCommand = de_ListQueueTagsCommand;
660
609
  const de_ListQueueTagsCommandError = async (output, context) => {
@@ -664,10 +613,9 @@ const de_ListQueueTagsCommandError = async (output, context) => {
664
613
  };
665
614
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
666
615
  const parsedBody = parsedOutput.body;
667
- (0, smithy_client_1.throwDefaultError)({
616
+ return throwDefaultError({
668
617
  output,
669
618
  parsedBody: parsedBody.Error,
670
- exceptionCtor: SQSServiceException_1.SQSServiceException,
671
619
  errorCode,
672
620
  });
673
621
  };
@@ -679,7 +627,7 @@ const de_PurgeQueueCommand = async (output, context) => {
679
627
  const response = {
680
628
  $metadata: deserializeMetadata(output),
681
629
  };
682
- return Promise.resolve(response);
630
+ return response;
683
631
  };
684
632
  exports.de_PurgeQueueCommand = de_PurgeQueueCommand;
685
633
  const de_PurgeQueueCommandError = async (output, context) => {
@@ -697,10 +645,9 @@ const de_PurgeQueueCommandError = async (output, context) => {
697
645
  throw await de_PurgeQueueInProgressRes(parsedOutput, context);
698
646
  default:
699
647
  const parsedBody = parsedOutput.body;
700
- (0, smithy_client_1.throwDefaultError)({
648
+ return throwDefaultError({
701
649
  output,
702
650
  parsedBody: parsedBody.Error,
703
- exceptionCtor: SQSServiceException_1.SQSServiceException,
704
651
  errorCode,
705
652
  });
706
653
  }
@@ -716,7 +663,7 @@ const de_ReceiveMessageCommand = async (output, context) => {
716
663
  $metadata: deserializeMetadata(output),
717
664
  ...contents,
718
665
  };
719
- return Promise.resolve(response);
666
+ return response;
720
667
  };
721
668
  exports.de_ReceiveMessageCommand = de_ReceiveMessageCommand;
722
669
  const de_ReceiveMessageCommandError = async (output, context) => {
@@ -731,10 +678,9 @@ const de_ReceiveMessageCommandError = async (output, context) => {
731
678
  throw await de_OverLimitRes(parsedOutput, context);
732
679
  default:
733
680
  const parsedBody = parsedOutput.body;
734
- (0, smithy_client_1.throwDefaultError)({
681
+ return throwDefaultError({
735
682
  output,
736
683
  parsedBody: parsedBody.Error,
737
- exceptionCtor: SQSServiceException_1.SQSServiceException,
738
684
  errorCode,
739
685
  });
740
686
  }
@@ -747,7 +693,7 @@ const de_RemovePermissionCommand = async (output, context) => {
747
693
  const response = {
748
694
  $metadata: deserializeMetadata(output),
749
695
  };
750
- return Promise.resolve(response);
696
+ return response;
751
697
  };
752
698
  exports.de_RemovePermissionCommand = de_RemovePermissionCommand;
753
699
  const de_RemovePermissionCommandError = async (output, context) => {
@@ -757,10 +703,9 @@ const de_RemovePermissionCommandError = async (output, context) => {
757
703
  };
758
704
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
759
705
  const parsedBody = parsedOutput.body;
760
- (0, smithy_client_1.throwDefaultError)({
706
+ return throwDefaultError({
761
707
  output,
762
708
  parsedBody: parsedBody.Error,
763
- exceptionCtor: SQSServiceException_1.SQSServiceException,
764
709
  errorCode,
765
710
  });
766
711
  };
@@ -775,7 +720,7 @@ const de_SendMessageCommand = async (output, context) => {
775
720
  $metadata: deserializeMetadata(output),
776
721
  ...contents,
777
722
  };
778
- return Promise.resolve(response);
723
+ return response;
779
724
  };
780
725
  exports.de_SendMessageCommand = de_SendMessageCommand;
781
726
  const de_SendMessageCommandError = async (output, context) => {
@@ -793,10 +738,9 @@ const de_SendMessageCommandError = async (output, context) => {
793
738
  throw await de_InvalidMessageContentsRes(parsedOutput, context);
794
739
  default:
795
740
  const parsedBody = parsedOutput.body;
796
- (0, smithy_client_1.throwDefaultError)({
741
+ return throwDefaultError({
797
742
  output,
798
743
  parsedBody: parsedBody.Error,
799
- exceptionCtor: SQSServiceException_1.SQSServiceException,
800
744
  errorCode,
801
745
  });
802
746
  }
@@ -812,7 +756,7 @@ const de_SendMessageBatchCommand = async (output, context) => {
812
756
  $metadata: deserializeMetadata(output),
813
757
  ...contents,
814
758
  };
815
- return Promise.resolve(response);
759
+ return response;
816
760
  };
817
761
  exports.de_SendMessageBatchCommand = de_SendMessageBatchCommand;
818
762
  const de_SendMessageBatchCommandError = async (output, context) => {
@@ -842,10 +786,9 @@ const de_SendMessageBatchCommandError = async (output, context) => {
842
786
  throw await de_UnsupportedOperationRes(parsedOutput, context);
843
787
  default:
844
788
  const parsedBody = parsedOutput.body;
845
- (0, smithy_client_1.throwDefaultError)({
789
+ return throwDefaultError({
846
790
  output,
847
791
  parsedBody: parsedBody.Error,
848
- exceptionCtor: SQSServiceException_1.SQSServiceException,
849
792
  errorCode,
850
793
  });
851
794
  }
@@ -858,7 +801,7 @@ const de_SetQueueAttributesCommand = async (output, context) => {
858
801
  const response = {
859
802
  $metadata: deserializeMetadata(output),
860
803
  };
861
- return Promise.resolve(response);
804
+ return response;
862
805
  };
863
806
  exports.de_SetQueueAttributesCommand = de_SetQueueAttributesCommand;
864
807
  const de_SetQueueAttributesCommandError = async (output, context) => {
@@ -873,10 +816,9 @@ const de_SetQueueAttributesCommandError = async (output, context) => {
873
816
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
874
817
  default:
875
818
  const parsedBody = parsedOutput.body;
876
- (0, smithy_client_1.throwDefaultError)({
819
+ return throwDefaultError({
877
820
  output,
878
821
  parsedBody: parsedBody.Error,
879
- exceptionCtor: SQSServiceException_1.SQSServiceException,
880
822
  errorCode,
881
823
  });
882
824
  }
@@ -889,7 +831,7 @@ const de_TagQueueCommand = async (output, context) => {
889
831
  const response = {
890
832
  $metadata: deserializeMetadata(output),
891
833
  };
892
- return Promise.resolve(response);
834
+ return response;
893
835
  };
894
836
  exports.de_TagQueueCommand = de_TagQueueCommand;
895
837
  const de_TagQueueCommandError = async (output, context) => {
@@ -899,10 +841,9 @@ const de_TagQueueCommandError = async (output, context) => {
899
841
  };
900
842
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
901
843
  const parsedBody = parsedOutput.body;
902
- (0, smithy_client_1.throwDefaultError)({
844
+ return throwDefaultError({
903
845
  output,
904
846
  parsedBody: parsedBody.Error,
905
- exceptionCtor: SQSServiceException_1.SQSServiceException,
906
847
  errorCode,
907
848
  });
908
849
  };
@@ -914,7 +855,7 @@ const de_UntagQueueCommand = async (output, context) => {
914
855
  const response = {
915
856
  $metadata: deserializeMetadata(output),
916
857
  };
917
- return Promise.resolve(response);
858
+ return response;
918
859
  };
919
860
  exports.de_UntagQueueCommand = de_UntagQueueCommand;
920
861
  const de_UntagQueueCommandError = async (output, context) => {
@@ -924,10 +865,9 @@ const de_UntagQueueCommandError = async (output, context) => {
924
865
  };
925
866
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
926
867
  const parsedBody = parsedOutput.body;
927
- (0, smithy_client_1.throwDefaultError)({
868
+ return throwDefaultError({
928
869
  output,
929
870
  parsedBody: parsedBody.Error,
930
- exceptionCtor: SQSServiceException_1.SQSServiceException,
931
871
  errorCode,
932
872
  });
933
873
  };
@@ -2120,6 +2060,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
2120
2060
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2121
2061
  };
2122
2062
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2063
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(SQSServiceException_1.SQSServiceException);
2123
2064
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
2124
2065
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2125
2066
  const contents = {
@@ -2138,6 +2079,9 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
2138
2079
  }
2139
2080
  return new protocol_http_1.HttpRequest(contents);
2140
2081
  };
2082
+ const SHARED_HEADERS = {
2083
+ "content-type": "application/x-www-form-urlencoded",
2084
+ };
2141
2085
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2142
2086
  if (encoded.length) {
2143
2087
  const parser = new fast_xml_parser_1.XMLParser({
@@ -1,12 +1,10 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getArrayIfSingleItem as __getArrayIfSingleItem, getValueFromTextNode as __getValueFromTextNode, parseBoolean as __parseBoolean, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { decorateServiceException as __decorateServiceException, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getArrayIfSingleItem as __getArrayIfSingleItem, getValueFromTextNode as __getValueFromTextNode, parseBoolean as __parseBoolean, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { XMLParser } from "fast-xml-parser";
4
4
  import { BatchEntryIdsNotDistinct, BatchRequestTooLong, EmptyBatchRequest, InvalidAttributeName, InvalidBatchEntryId, InvalidIdFormat, InvalidMessageContents, MessageNotInflight, OverLimit, PurgeQueueInProgress, QueueDeletedRecently, QueueDoesNotExist, QueueNameExists, ReceiptHandleIsInvalid, TooManyEntriesInBatchRequest, UnsupportedOperation, } from "../models/models_0";
5
5
  import { SQSServiceException as __BaseException } from "../models/SQSServiceException";
6
6
  export const se_AddPermissionCommand = async (input, context) => {
7
- const headers = {
8
- "content-type": "application/x-www-form-urlencoded",
9
- };
7
+ const headers = SHARED_HEADERS;
10
8
  let body;
11
9
  body = buildFormUrlencodedString({
12
10
  ...se_AddPermissionRequest(input, context),
@@ -16,9 +14,7 @@ export const se_AddPermissionCommand = async (input, context) => {
16
14
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
15
  };
18
16
  export const se_ChangeMessageVisibilityCommand = async (input, context) => {
19
- const headers = {
20
- "content-type": "application/x-www-form-urlencoded",
21
- };
17
+ const headers = SHARED_HEADERS;
22
18
  let body;
23
19
  body = buildFormUrlencodedString({
24
20
  ...se_ChangeMessageVisibilityRequest(input, context),
@@ -28,9 +24,7 @@ export const se_ChangeMessageVisibilityCommand = async (input, context) => {
28
24
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
29
25
  };
30
26
  export const se_ChangeMessageVisibilityBatchCommand = async (input, context) => {
31
- const headers = {
32
- "content-type": "application/x-www-form-urlencoded",
33
- };
27
+ const headers = SHARED_HEADERS;
34
28
  let body;
35
29
  body = buildFormUrlencodedString({
36
30
  ...se_ChangeMessageVisibilityBatchRequest(input, context),
@@ -40,9 +34,7 @@ export const se_ChangeMessageVisibilityBatchCommand = async (input, context) =>
40
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
35
  };
42
36
  export const se_CreateQueueCommand = async (input, context) => {
43
- const headers = {
44
- "content-type": "application/x-www-form-urlencoded",
45
- };
37
+ const headers = SHARED_HEADERS;
46
38
  let body;
47
39
  body = buildFormUrlencodedString({
48
40
  ...se_CreateQueueRequest(input, context),
@@ -52,9 +44,7 @@ export const se_CreateQueueCommand = async (input, context) => {
52
44
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
53
45
  };
54
46
  export const se_DeleteMessageCommand = async (input, context) => {
55
- const headers = {
56
- "content-type": "application/x-www-form-urlencoded",
57
- };
47
+ const headers = SHARED_HEADERS;
58
48
  let body;
59
49
  body = buildFormUrlencodedString({
60
50
  ...se_DeleteMessageRequest(input, context),
@@ -64,9 +54,7 @@ export const se_DeleteMessageCommand = async (input, context) => {
64
54
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
65
55
  };
66
56
  export const se_DeleteMessageBatchCommand = async (input, context) => {
67
- const headers = {
68
- "content-type": "application/x-www-form-urlencoded",
69
- };
57
+ const headers = SHARED_HEADERS;
70
58
  let body;
71
59
  body = buildFormUrlencodedString({
72
60
  ...se_DeleteMessageBatchRequest(input, context),
@@ -76,9 +64,7 @@ export const se_DeleteMessageBatchCommand = async (input, context) => {
76
64
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
65
  };
78
66
  export const se_DeleteQueueCommand = async (input, context) => {
79
- const headers = {
80
- "content-type": "application/x-www-form-urlencoded",
81
- };
67
+ const headers = SHARED_HEADERS;
82
68
  let body;
83
69
  body = buildFormUrlencodedString({
84
70
  ...se_DeleteQueueRequest(input, context),
@@ -88,9 +74,7 @@ export const se_DeleteQueueCommand = async (input, context) => {
88
74
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
89
75
  };
90
76
  export const se_GetQueueAttributesCommand = async (input, context) => {
91
- const headers = {
92
- "content-type": "application/x-www-form-urlencoded",
93
- };
77
+ const headers = SHARED_HEADERS;
94
78
  let body;
95
79
  body = buildFormUrlencodedString({
96
80
  ...se_GetQueueAttributesRequest(input, context),
@@ -100,9 +84,7 @@ export const se_GetQueueAttributesCommand = async (input, context) => {
100
84
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
101
85
  };
102
86
  export const se_GetQueueUrlCommand = async (input, context) => {
103
- const headers = {
104
- "content-type": "application/x-www-form-urlencoded",
105
- };
87
+ const headers = SHARED_HEADERS;
106
88
  let body;
107
89
  body = buildFormUrlencodedString({
108
90
  ...se_GetQueueUrlRequest(input, context),
@@ -112,9 +94,7 @@ export const se_GetQueueUrlCommand = async (input, context) => {
112
94
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
95
  };
114
96
  export const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
115
- const headers = {
116
- "content-type": "application/x-www-form-urlencoded",
117
- };
97
+ const headers = SHARED_HEADERS;
118
98
  let body;
119
99
  body = buildFormUrlencodedString({
120
100
  ...se_ListDeadLetterSourceQueuesRequest(input, context),
@@ -124,9 +104,7 @@ export const se_ListDeadLetterSourceQueuesCommand = async (input, context) => {
124
104
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
125
105
  };
126
106
  export const se_ListQueuesCommand = async (input, context) => {
127
- const headers = {
128
- "content-type": "application/x-www-form-urlencoded",
129
- };
107
+ const headers = SHARED_HEADERS;
130
108
  let body;
131
109
  body = buildFormUrlencodedString({
132
110
  ...se_ListQueuesRequest(input, context),
@@ -136,9 +114,7 @@ export const se_ListQueuesCommand = async (input, context) => {
136
114
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
137
115
  };
138
116
  export const se_ListQueueTagsCommand = async (input, context) => {
139
- const headers = {
140
- "content-type": "application/x-www-form-urlencoded",
141
- };
117
+ const headers = SHARED_HEADERS;
142
118
  let body;
143
119
  body = buildFormUrlencodedString({
144
120
  ...se_ListQueueTagsRequest(input, context),
@@ -148,9 +124,7 @@ export const se_ListQueueTagsCommand = async (input, context) => {
148
124
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
149
125
  };
150
126
  export const se_PurgeQueueCommand = async (input, context) => {
151
- const headers = {
152
- "content-type": "application/x-www-form-urlencoded",
153
- };
127
+ const headers = SHARED_HEADERS;
154
128
  let body;
155
129
  body = buildFormUrlencodedString({
156
130
  ...se_PurgeQueueRequest(input, context),
@@ -160,9 +134,7 @@ export const se_PurgeQueueCommand = async (input, context) => {
160
134
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
135
  };
162
136
  export const se_ReceiveMessageCommand = async (input, context) => {
163
- const headers = {
164
- "content-type": "application/x-www-form-urlencoded",
165
- };
137
+ const headers = SHARED_HEADERS;
166
138
  let body;
167
139
  body = buildFormUrlencodedString({
168
140
  ...se_ReceiveMessageRequest(input, context),
@@ -172,9 +144,7 @@ export const se_ReceiveMessageCommand = async (input, context) => {
172
144
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
173
145
  };
174
146
  export const se_RemovePermissionCommand = async (input, context) => {
175
- const headers = {
176
- "content-type": "application/x-www-form-urlencoded",
177
- };
147
+ const headers = SHARED_HEADERS;
178
148
  let body;
179
149
  body = buildFormUrlencodedString({
180
150
  ...se_RemovePermissionRequest(input, context),
@@ -184,9 +154,7 @@ export const se_RemovePermissionCommand = async (input, context) => {
184
154
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
185
155
  };
186
156
  export const se_SendMessageCommand = async (input, context) => {
187
- const headers = {
188
- "content-type": "application/x-www-form-urlencoded",
189
- };
157
+ const headers = SHARED_HEADERS;
190
158
  let body;
191
159
  body = buildFormUrlencodedString({
192
160
  ...se_SendMessageRequest(input, context),
@@ -196,9 +164,7 @@ export const se_SendMessageCommand = async (input, context) => {
196
164
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
197
165
  };
198
166
  export const se_SendMessageBatchCommand = async (input, context) => {
199
- const headers = {
200
- "content-type": "application/x-www-form-urlencoded",
201
- };
167
+ const headers = SHARED_HEADERS;
202
168
  let body;
203
169
  body = buildFormUrlencodedString({
204
170
  ...se_SendMessageBatchRequest(input, context),
@@ -208,9 +174,7 @@ export const se_SendMessageBatchCommand = async (input, context) => {
208
174
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
209
175
  };
210
176
  export const se_SetQueueAttributesCommand = async (input, context) => {
211
- const headers = {
212
- "content-type": "application/x-www-form-urlencoded",
213
- };
177
+ const headers = SHARED_HEADERS;
214
178
  let body;
215
179
  body = buildFormUrlencodedString({
216
180
  ...se_SetQueueAttributesRequest(input, context),
@@ -220,9 +184,7 @@ export const se_SetQueueAttributesCommand = async (input, context) => {
220
184
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
221
185
  };
222
186
  export const se_TagQueueCommand = async (input, context) => {
223
- const headers = {
224
- "content-type": "application/x-www-form-urlencoded",
225
- };
187
+ const headers = SHARED_HEADERS;
226
188
  let body;
227
189
  body = buildFormUrlencodedString({
228
190
  ...se_TagQueueRequest(input, context),
@@ -232,9 +194,7 @@ export const se_TagQueueCommand = async (input, context) => {
232
194
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
233
195
  };
234
196
  export const se_UntagQueueCommand = async (input, context) => {
235
- const headers = {
236
- "content-type": "application/x-www-form-urlencoded",
237
- };
197
+ const headers = SHARED_HEADERS;
238
198
  let body;
239
199
  body = buildFormUrlencodedString({
240
200
  ...se_UntagQueueRequest(input, context),
@@ -251,7 +211,7 @@ export const de_AddPermissionCommand = async (output, context) => {
251
211
  const response = {
252
212
  $metadata: deserializeMetadata(output),
253
213
  };
254
- return Promise.resolve(response);
214
+ return response;
255
215
  };
256
216
  const de_AddPermissionCommandError = async (output, context) => {
257
217
  const parsedOutput = {
@@ -265,10 +225,9 @@ const de_AddPermissionCommandError = async (output, context) => {
265
225
  throw await de_OverLimitRes(parsedOutput, context);
266
226
  default:
267
227
  const parsedBody = parsedOutput.body;
268
- throwDefaultError({
228
+ return throwDefaultError({
269
229
  output,
270
230
  parsedBody: parsedBody.Error,
271
- exceptionCtor: __BaseException,
272
231
  errorCode,
273
232
  });
274
233
  }
@@ -281,7 +240,7 @@ export const de_ChangeMessageVisibilityCommand = async (output, context) => {
281
240
  const response = {
282
241
  $metadata: deserializeMetadata(output),
283
242
  };
284
- return Promise.resolve(response);
243
+ return response;
285
244
  };
286
245
  const de_ChangeMessageVisibilityCommandError = async (output, context) => {
287
246
  const parsedOutput = {
@@ -298,10 +257,9 @@ const de_ChangeMessageVisibilityCommandError = async (output, context) => {
298
257
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
299
258
  default:
300
259
  const parsedBody = parsedOutput.body;
301
- throwDefaultError({
260
+ return throwDefaultError({
302
261
  output,
303
262
  parsedBody: parsedBody.Error,
304
- exceptionCtor: __BaseException,
305
263
  errorCode,
306
264
  });
307
265
  }
@@ -317,7 +275,7 @@ export const de_ChangeMessageVisibilityBatchCommand = async (output, context) =>
317
275
  $metadata: deserializeMetadata(output),
318
276
  ...contents,
319
277
  };
320
- return Promise.resolve(response);
278
+ return response;
321
279
  };
322
280
  const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
323
281
  const parsedOutput = {
@@ -340,10 +298,9 @@ const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
340
298
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
341
299
  default:
342
300
  const parsedBody = parsedOutput.body;
343
- throwDefaultError({
301
+ return throwDefaultError({
344
302
  output,
345
303
  parsedBody: parsedBody.Error,
346
- exceptionCtor: __BaseException,
347
304
  errorCode,
348
305
  });
349
306
  }
@@ -359,7 +316,7 @@ export const de_CreateQueueCommand = async (output, context) => {
359
316
  $metadata: deserializeMetadata(output),
360
317
  ...contents,
361
318
  };
362
- return Promise.resolve(response);
319
+ return response;
363
320
  };
364
321
  const de_CreateQueueCommandError = async (output, context) => {
365
322
  const parsedOutput = {
@@ -376,10 +333,9 @@ const de_CreateQueueCommandError = async (output, context) => {
376
333
  throw await de_QueueNameExistsRes(parsedOutput, context);
377
334
  default:
378
335
  const parsedBody = parsedOutput.body;
379
- throwDefaultError({
336
+ return throwDefaultError({
380
337
  output,
381
338
  parsedBody: parsedBody.Error,
382
- exceptionCtor: __BaseException,
383
339
  errorCode,
384
340
  });
385
341
  }
@@ -392,7 +348,7 @@ export const de_DeleteMessageCommand = async (output, context) => {
392
348
  const response = {
393
349
  $metadata: deserializeMetadata(output),
394
350
  };
395
- return Promise.resolve(response);
351
+ return response;
396
352
  };
397
353
  const de_DeleteMessageCommandError = async (output, context) => {
398
354
  const parsedOutput = {
@@ -409,10 +365,9 @@ const de_DeleteMessageCommandError = async (output, context) => {
409
365
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
410
366
  default:
411
367
  const parsedBody = parsedOutput.body;
412
- throwDefaultError({
368
+ return throwDefaultError({
413
369
  output,
414
370
  parsedBody: parsedBody.Error,
415
- exceptionCtor: __BaseException,
416
371
  errorCode,
417
372
  });
418
373
  }
@@ -428,7 +383,7 @@ export const de_DeleteMessageBatchCommand = async (output, context) => {
428
383
  $metadata: deserializeMetadata(output),
429
384
  ...contents,
430
385
  };
431
- return Promise.resolve(response);
386
+ return response;
432
387
  };
433
388
  const de_DeleteMessageBatchCommandError = async (output, context) => {
434
389
  const parsedOutput = {
@@ -451,10 +406,9 @@ const de_DeleteMessageBatchCommandError = async (output, context) => {
451
406
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
452
407
  default:
453
408
  const parsedBody = parsedOutput.body;
454
- throwDefaultError({
409
+ return throwDefaultError({
455
410
  output,
456
411
  parsedBody: parsedBody.Error,
457
- exceptionCtor: __BaseException,
458
412
  errorCode,
459
413
  });
460
414
  }
@@ -467,7 +421,7 @@ export const de_DeleteQueueCommand = async (output, context) => {
467
421
  const response = {
468
422
  $metadata: deserializeMetadata(output),
469
423
  };
470
- return Promise.resolve(response);
424
+ return response;
471
425
  };
472
426
  const de_DeleteQueueCommandError = async (output, context) => {
473
427
  const parsedOutput = {
@@ -476,10 +430,9 @@ const de_DeleteQueueCommandError = async (output, context) => {
476
430
  };
477
431
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
478
432
  const parsedBody = parsedOutput.body;
479
- throwDefaultError({
433
+ return throwDefaultError({
480
434
  output,
481
435
  parsedBody: parsedBody.Error,
482
- exceptionCtor: __BaseException,
483
436
  errorCode,
484
437
  });
485
438
  };
@@ -494,7 +447,7 @@ export const de_GetQueueAttributesCommand = async (output, context) => {
494
447
  $metadata: deserializeMetadata(output),
495
448
  ...contents,
496
449
  };
497
- return Promise.resolve(response);
450
+ return response;
498
451
  };
499
452
  const de_GetQueueAttributesCommandError = async (output, context) => {
500
453
  const parsedOutput = {
@@ -508,10 +461,9 @@ const de_GetQueueAttributesCommandError = async (output, context) => {
508
461
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
509
462
  default:
510
463
  const parsedBody = parsedOutput.body;
511
- throwDefaultError({
464
+ return throwDefaultError({
512
465
  output,
513
466
  parsedBody: parsedBody.Error,
514
- exceptionCtor: __BaseException,
515
467
  errorCode,
516
468
  });
517
469
  }
@@ -527,7 +479,7 @@ export const de_GetQueueUrlCommand = async (output, context) => {
527
479
  $metadata: deserializeMetadata(output),
528
480
  ...contents,
529
481
  };
530
- return Promise.resolve(response);
482
+ return response;
531
483
  };
532
484
  const de_GetQueueUrlCommandError = async (output, context) => {
533
485
  const parsedOutput = {
@@ -541,10 +493,9 @@ const de_GetQueueUrlCommandError = async (output, context) => {
541
493
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
542
494
  default:
543
495
  const parsedBody = parsedOutput.body;
544
- throwDefaultError({
496
+ return throwDefaultError({
545
497
  output,
546
498
  parsedBody: parsedBody.Error,
547
- exceptionCtor: __BaseException,
548
499
  errorCode,
549
500
  });
550
501
  }
@@ -560,7 +511,7 @@ export const de_ListDeadLetterSourceQueuesCommand = async (output, context) => {
560
511
  $metadata: deserializeMetadata(output),
561
512
  ...contents,
562
513
  };
563
- return Promise.resolve(response);
514
+ return response;
564
515
  };
565
516
  const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
566
517
  const parsedOutput = {
@@ -574,10 +525,9 @@ const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
574
525
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
575
526
  default:
576
527
  const parsedBody = parsedOutput.body;
577
- throwDefaultError({
528
+ return throwDefaultError({
578
529
  output,
579
530
  parsedBody: parsedBody.Error,
580
- exceptionCtor: __BaseException,
581
531
  errorCode,
582
532
  });
583
533
  }
@@ -593,7 +543,7 @@ export const de_ListQueuesCommand = async (output, context) => {
593
543
  $metadata: deserializeMetadata(output),
594
544
  ...contents,
595
545
  };
596
- return Promise.resolve(response);
546
+ return response;
597
547
  };
598
548
  const de_ListQueuesCommandError = async (output, context) => {
599
549
  const parsedOutput = {
@@ -602,10 +552,9 @@ const de_ListQueuesCommandError = async (output, context) => {
602
552
  };
603
553
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
604
554
  const parsedBody = parsedOutput.body;
605
- throwDefaultError({
555
+ return throwDefaultError({
606
556
  output,
607
557
  parsedBody: parsedBody.Error,
608
- exceptionCtor: __BaseException,
609
558
  errorCode,
610
559
  });
611
560
  };
@@ -620,7 +569,7 @@ export const de_ListQueueTagsCommand = async (output, context) => {
620
569
  $metadata: deserializeMetadata(output),
621
570
  ...contents,
622
571
  };
623
- return Promise.resolve(response);
572
+ return response;
624
573
  };
625
574
  const de_ListQueueTagsCommandError = async (output, context) => {
626
575
  const parsedOutput = {
@@ -629,10 +578,9 @@ const de_ListQueueTagsCommandError = async (output, context) => {
629
578
  };
630
579
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
631
580
  const parsedBody = parsedOutput.body;
632
- throwDefaultError({
581
+ return throwDefaultError({
633
582
  output,
634
583
  parsedBody: parsedBody.Error,
635
- exceptionCtor: __BaseException,
636
584
  errorCode,
637
585
  });
638
586
  };
@@ -644,7 +592,7 @@ export const de_PurgeQueueCommand = async (output, context) => {
644
592
  const response = {
645
593
  $metadata: deserializeMetadata(output),
646
594
  };
647
- return Promise.resolve(response);
595
+ return response;
648
596
  };
649
597
  const de_PurgeQueueCommandError = async (output, context) => {
650
598
  const parsedOutput = {
@@ -661,10 +609,9 @@ const de_PurgeQueueCommandError = async (output, context) => {
661
609
  throw await de_PurgeQueueInProgressRes(parsedOutput, context);
662
610
  default:
663
611
  const parsedBody = parsedOutput.body;
664
- throwDefaultError({
612
+ return throwDefaultError({
665
613
  output,
666
614
  parsedBody: parsedBody.Error,
667
- exceptionCtor: __BaseException,
668
615
  errorCode,
669
616
  });
670
617
  }
@@ -680,7 +627,7 @@ export const de_ReceiveMessageCommand = async (output, context) => {
680
627
  $metadata: deserializeMetadata(output),
681
628
  ...contents,
682
629
  };
683
- return Promise.resolve(response);
630
+ return response;
684
631
  };
685
632
  const de_ReceiveMessageCommandError = async (output, context) => {
686
633
  const parsedOutput = {
@@ -694,10 +641,9 @@ const de_ReceiveMessageCommandError = async (output, context) => {
694
641
  throw await de_OverLimitRes(parsedOutput, context);
695
642
  default:
696
643
  const parsedBody = parsedOutput.body;
697
- throwDefaultError({
644
+ return throwDefaultError({
698
645
  output,
699
646
  parsedBody: parsedBody.Error,
700
- exceptionCtor: __BaseException,
701
647
  errorCode,
702
648
  });
703
649
  }
@@ -710,7 +656,7 @@ export const de_RemovePermissionCommand = async (output, context) => {
710
656
  const response = {
711
657
  $metadata: deserializeMetadata(output),
712
658
  };
713
- return Promise.resolve(response);
659
+ return response;
714
660
  };
715
661
  const de_RemovePermissionCommandError = async (output, context) => {
716
662
  const parsedOutput = {
@@ -719,10 +665,9 @@ const de_RemovePermissionCommandError = async (output, context) => {
719
665
  };
720
666
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
721
667
  const parsedBody = parsedOutput.body;
722
- throwDefaultError({
668
+ return throwDefaultError({
723
669
  output,
724
670
  parsedBody: parsedBody.Error,
725
- exceptionCtor: __BaseException,
726
671
  errorCode,
727
672
  });
728
673
  };
@@ -737,7 +682,7 @@ export const de_SendMessageCommand = async (output, context) => {
737
682
  $metadata: deserializeMetadata(output),
738
683
  ...contents,
739
684
  };
740
- return Promise.resolve(response);
685
+ return response;
741
686
  };
742
687
  const de_SendMessageCommandError = async (output, context) => {
743
688
  const parsedOutput = {
@@ -754,10 +699,9 @@ const de_SendMessageCommandError = async (output, context) => {
754
699
  throw await de_InvalidMessageContentsRes(parsedOutput, context);
755
700
  default:
756
701
  const parsedBody = parsedOutput.body;
757
- throwDefaultError({
702
+ return throwDefaultError({
758
703
  output,
759
704
  parsedBody: parsedBody.Error,
760
- exceptionCtor: __BaseException,
761
705
  errorCode,
762
706
  });
763
707
  }
@@ -773,7 +717,7 @@ export const de_SendMessageBatchCommand = async (output, context) => {
773
717
  $metadata: deserializeMetadata(output),
774
718
  ...contents,
775
719
  };
776
- return Promise.resolve(response);
720
+ return response;
777
721
  };
778
722
  const de_SendMessageBatchCommandError = async (output, context) => {
779
723
  const parsedOutput = {
@@ -802,10 +746,9 @@ const de_SendMessageBatchCommandError = async (output, context) => {
802
746
  throw await de_UnsupportedOperationRes(parsedOutput, context);
803
747
  default:
804
748
  const parsedBody = parsedOutput.body;
805
- throwDefaultError({
749
+ return throwDefaultError({
806
750
  output,
807
751
  parsedBody: parsedBody.Error,
808
- exceptionCtor: __BaseException,
809
752
  errorCode,
810
753
  });
811
754
  }
@@ -818,7 +761,7 @@ export const de_SetQueueAttributesCommand = async (output, context) => {
818
761
  const response = {
819
762
  $metadata: deserializeMetadata(output),
820
763
  };
821
- return Promise.resolve(response);
764
+ return response;
822
765
  };
823
766
  const de_SetQueueAttributesCommandError = async (output, context) => {
824
767
  const parsedOutput = {
@@ -832,10 +775,9 @@ const de_SetQueueAttributesCommandError = async (output, context) => {
832
775
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
833
776
  default:
834
777
  const parsedBody = parsedOutput.body;
835
- throwDefaultError({
778
+ return throwDefaultError({
836
779
  output,
837
780
  parsedBody: parsedBody.Error,
838
- exceptionCtor: __BaseException,
839
781
  errorCode,
840
782
  });
841
783
  }
@@ -848,7 +790,7 @@ export const de_TagQueueCommand = async (output, context) => {
848
790
  const response = {
849
791
  $metadata: deserializeMetadata(output),
850
792
  };
851
- return Promise.resolve(response);
793
+ return response;
852
794
  };
853
795
  const de_TagQueueCommandError = async (output, context) => {
854
796
  const parsedOutput = {
@@ -857,10 +799,9 @@ const de_TagQueueCommandError = async (output, context) => {
857
799
  };
858
800
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
859
801
  const parsedBody = parsedOutput.body;
860
- throwDefaultError({
802
+ return throwDefaultError({
861
803
  output,
862
804
  parsedBody: parsedBody.Error,
863
- exceptionCtor: __BaseException,
864
805
  errorCode,
865
806
  });
866
807
  };
@@ -872,7 +813,7 @@ export const de_UntagQueueCommand = async (output, context) => {
872
813
  const response = {
873
814
  $metadata: deserializeMetadata(output),
874
815
  };
875
- return Promise.resolve(response);
816
+ return response;
876
817
  };
877
818
  const de_UntagQueueCommandError = async (output, context) => {
878
819
  const parsedOutput = {
@@ -881,10 +822,9 @@ const de_UntagQueueCommandError = async (output, context) => {
881
822
  };
882
823
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
883
824
  const parsedBody = parsedOutput.body;
884
- throwDefaultError({
825
+ return throwDefaultError({
885
826
  output,
886
827
  parsedBody: parsedBody.Error,
887
- exceptionCtor: __BaseException,
888
828
  errorCode,
889
829
  });
890
830
  };
@@ -2077,6 +2017,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
2077
2017
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2078
2018
  };
2079
2019
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2020
+ const throwDefaultError = withBaseException(__BaseException);
2080
2021
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
2081
2022
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2082
2023
  const contents = {
@@ -2095,6 +2036,9 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
2095
2036
  }
2096
2037
  return new __HttpRequest(contents);
2097
2038
  };
2039
+ const SHARED_HEADERS = {
2040
+ "content-type": "application/x-www-form-urlencoded",
2041
+ };
2098
2042
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2099
2043
  if (encoded.length) {
2100
2044
  const parser = new XMLParser({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sqs",
3
3
  "description": "AWS SDK for JavaScript Sqs Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -42,14 +42,14 @@
42
42
  "@aws-sdk/node-config-provider": "3.310.0",
43
43
  "@aws-sdk/node-http-handler": "3.310.0",
44
44
  "@aws-sdk/protocol-http": "3.310.0",
45
- "@aws-sdk/smithy-client": "3.310.0",
45
+ "@aws-sdk/smithy-client": "3.315.0",
46
46
  "@aws-sdk/types": "3.310.0",
47
47
  "@aws-sdk/url-parser": "3.310.0",
48
48
  "@aws-sdk/util-base64": "3.310.0",
49
49
  "@aws-sdk/util-body-length-browser": "3.310.0",
50
50
  "@aws-sdk/util-body-length-node": "3.310.0",
51
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
52
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
51
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
52
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
53
53
  "@aws-sdk/util-endpoints": "3.310.0",
54
54
  "@aws-sdk/util-retry": "3.310.0",
55
55
  "@aws-sdk/util-user-agent-browser": "3.310.0",