@aws-sdk/client-firehose 3.52.0 → 3.53.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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_json1_1UpdateDestinationCommand = exports.deserializeAws_json1_1UntagDeliveryStreamCommand = exports.deserializeAws_json1_1TagDeliveryStreamCommand = exports.deserializeAws_json1_1StopDeliveryStreamEncryptionCommand = exports.deserializeAws_json1_1StartDeliveryStreamEncryptionCommand = exports.deserializeAws_json1_1PutRecordBatchCommand = exports.deserializeAws_json1_1PutRecordCommand = exports.deserializeAws_json1_1ListTagsForDeliveryStreamCommand = exports.deserializeAws_json1_1ListDeliveryStreamsCommand = exports.deserializeAws_json1_1DescribeDeliveryStreamCommand = exports.deserializeAws_json1_1DeleteDeliveryStreamCommand = exports.deserializeAws_json1_1CreateDeliveryStreamCommand = exports.serializeAws_json1_1UpdateDestinationCommand = exports.serializeAws_json1_1UntagDeliveryStreamCommand = exports.serializeAws_json1_1TagDeliveryStreamCommand = exports.serializeAws_json1_1StopDeliveryStreamEncryptionCommand = exports.serializeAws_json1_1StartDeliveryStreamEncryptionCommand = exports.serializeAws_json1_1PutRecordBatchCommand = exports.serializeAws_json1_1PutRecordCommand = exports.serializeAws_json1_1ListTagsForDeliveryStreamCommand = exports.serializeAws_json1_1ListDeliveryStreamsCommand = exports.serializeAws_json1_1DescribeDeliveryStreamCommand = exports.serializeAws_json1_1DeleteDeliveryStreamCommand = exports.serializeAws_json1_1CreateDeliveryStreamCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const FirehoseServiceException_1 = require("../models/FirehoseServiceException");
7
+ const models_0_1 = require("../models/models_0");
6
8
  const serializeAws_json1_1CreateDeliveryStreamCommand = async (input, context) => {
7
9
  const headers = {
8
10
  "content-type": "application/x-amz-json-1.1",
@@ -148,51 +150,25 @@ const deserializeAws_json1_1CreateDeliveryStreamCommandError = async (output, co
148
150
  switch (errorCode) {
149
151
  case "InvalidArgumentException":
150
152
  case "com.amazonaws.firehose#InvalidArgumentException":
151
- response = {
152
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
153
- name: errorCode,
154
- $metadata: deserializeMetadata(output),
155
- };
156
- break;
153
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
157
154
  case "InvalidKMSResourceException":
158
155
  case "com.amazonaws.firehose#InvalidKMSResourceException":
159
- response = {
160
- ...(await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context)),
161
- name: errorCode,
162
- $metadata: deserializeMetadata(output),
163
- };
164
- break;
156
+ throw await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context);
165
157
  case "LimitExceededException":
166
158
  case "com.amazonaws.firehose#LimitExceededException":
167
- response = {
168
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
169
- name: errorCode,
170
- $metadata: deserializeMetadata(output),
171
- };
172
- break;
159
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
173
160
  case "ResourceInUseException":
174
161
  case "com.amazonaws.firehose#ResourceInUseException":
175
- response = {
176
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
177
- name: errorCode,
178
- $metadata: deserializeMetadata(output),
179
- };
180
- break;
162
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
181
163
  default:
182
164
  const parsedBody = parsedOutput.body;
183
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
184
- response = {
185
- ...parsedBody,
186
- name: `${errorCode}`,
187
- message: parsedBody.message || parsedBody.Message || errorCode,
165
+ response = new FirehoseServiceException_1.FirehoseServiceException({
166
+ name: parsedBody.code || parsedBody.Code || errorCode,
188
167
  $fault: "client",
189
168
  $metadata: deserializeMetadata(output),
190
- };
169
+ });
170
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
191
171
  }
192
- const message = response.message || response.Message || errorCode;
193
- response.message = message;
194
- delete response.Message;
195
- return Promise.reject(Object.assign(new Error(message), response));
196
172
  };
197
173
  const deserializeAws_json1_1DeleteDeliveryStreamCommand = async (output, context) => {
198
174
  if (output.statusCode >= 300) {
@@ -219,35 +195,19 @@ const deserializeAws_json1_1DeleteDeliveryStreamCommandError = async (output, co
219
195
  switch (errorCode) {
220
196
  case "ResourceInUseException":
221
197
  case "com.amazonaws.firehose#ResourceInUseException":
222
- response = {
223
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
224
- name: errorCode,
225
- $metadata: deserializeMetadata(output),
226
- };
227
- break;
198
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
228
199
  case "ResourceNotFoundException":
229
200
  case "com.amazonaws.firehose#ResourceNotFoundException":
230
- response = {
231
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
232
- name: errorCode,
233
- $metadata: deserializeMetadata(output),
234
- };
235
- break;
201
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
236
202
  default:
237
203
  const parsedBody = parsedOutput.body;
238
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
239
- response = {
240
- ...parsedBody,
241
- name: `${errorCode}`,
242
- message: parsedBody.message || parsedBody.Message || errorCode,
204
+ response = new FirehoseServiceException_1.FirehoseServiceException({
205
+ name: parsedBody.code || parsedBody.Code || errorCode,
243
206
  $fault: "client",
244
207
  $metadata: deserializeMetadata(output),
245
- };
208
+ });
209
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
246
210
  }
247
- const message = response.message || response.Message || errorCode;
248
- response.message = message;
249
- delete response.Message;
250
- return Promise.reject(Object.assign(new Error(message), response));
251
211
  };
252
212
  const deserializeAws_json1_1DescribeDeliveryStreamCommand = async (output, context) => {
253
213
  if (output.statusCode >= 300) {
@@ -274,27 +234,16 @@ const deserializeAws_json1_1DescribeDeliveryStreamCommandError = async (output,
274
234
  switch (errorCode) {
275
235
  case "ResourceNotFoundException":
276
236
  case "com.amazonaws.firehose#ResourceNotFoundException":
277
- response = {
278
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
279
- name: errorCode,
280
- $metadata: deserializeMetadata(output),
281
- };
282
- break;
237
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
283
238
  default:
284
239
  const parsedBody = parsedOutput.body;
285
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
286
- response = {
287
- ...parsedBody,
288
- name: `${errorCode}`,
289
- message: parsedBody.message || parsedBody.Message || errorCode,
240
+ response = new FirehoseServiceException_1.FirehoseServiceException({
241
+ name: parsedBody.code || parsedBody.Code || errorCode,
290
242
  $fault: "client",
291
243
  $metadata: deserializeMetadata(output),
292
- };
244
+ });
245
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
293
246
  }
294
- const message = response.message || response.Message || errorCode;
295
- response.message = message;
296
- delete response.Message;
297
- return Promise.reject(Object.assign(new Error(message), response));
298
247
  };
299
248
  const deserializeAws_json1_1ListDeliveryStreamsCommand = async (output, context) => {
300
249
  if (output.statusCode >= 300) {
@@ -321,19 +270,13 @@ const deserializeAws_json1_1ListDeliveryStreamsCommandError = async (output, con
321
270
  switch (errorCode) {
322
271
  default:
323
272
  const parsedBody = parsedOutput.body;
324
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
325
- response = {
326
- ...parsedBody,
327
- name: `${errorCode}`,
328
- message: parsedBody.message || parsedBody.Message || errorCode,
273
+ response = new FirehoseServiceException_1.FirehoseServiceException({
274
+ name: parsedBody.code || parsedBody.Code || errorCode,
329
275
  $fault: "client",
330
276
  $metadata: deserializeMetadata(output),
331
- };
277
+ });
278
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
332
279
  }
333
- const message = response.message || response.Message || errorCode;
334
- response.message = message;
335
- delete response.Message;
336
- return Promise.reject(Object.assign(new Error(message), response));
337
280
  };
338
281
  const deserializeAws_json1_1ListTagsForDeliveryStreamCommand = async (output, context) => {
339
282
  if (output.statusCode >= 300) {
@@ -360,43 +303,22 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamCommandError = async (outpu
360
303
  switch (errorCode) {
361
304
  case "InvalidArgumentException":
362
305
  case "com.amazonaws.firehose#InvalidArgumentException":
363
- response = {
364
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
365
- name: errorCode,
366
- $metadata: deserializeMetadata(output),
367
- };
368
- break;
306
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
369
307
  case "LimitExceededException":
370
308
  case "com.amazonaws.firehose#LimitExceededException":
371
- response = {
372
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
373
- name: errorCode,
374
- $metadata: deserializeMetadata(output),
375
- };
376
- break;
309
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
377
310
  case "ResourceNotFoundException":
378
311
  case "com.amazonaws.firehose#ResourceNotFoundException":
379
- response = {
380
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
381
- name: errorCode,
382
- $metadata: deserializeMetadata(output),
383
- };
384
- break;
312
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
385
313
  default:
386
314
  const parsedBody = parsedOutput.body;
387
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
388
- response = {
389
- ...parsedBody,
390
- name: `${errorCode}`,
391
- message: parsedBody.message || parsedBody.Message || errorCode,
315
+ response = new FirehoseServiceException_1.FirehoseServiceException({
316
+ name: parsedBody.code || parsedBody.Code || errorCode,
392
317
  $fault: "client",
393
318
  $metadata: deserializeMetadata(output),
394
- };
319
+ });
320
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
395
321
  }
396
- const message = response.message || response.Message || errorCode;
397
- response.message = message;
398
- delete response.Message;
399
- return Promise.reject(Object.assign(new Error(message), response));
400
322
  };
401
323
  const deserializeAws_json1_1PutRecordCommand = async (output, context) => {
402
324
  if (output.statusCode >= 300) {
@@ -423,51 +345,25 @@ const deserializeAws_json1_1PutRecordCommandError = async (output, context) => {
423
345
  switch (errorCode) {
424
346
  case "InvalidArgumentException":
425
347
  case "com.amazonaws.firehose#InvalidArgumentException":
426
- response = {
427
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
428
- name: errorCode,
429
- $metadata: deserializeMetadata(output),
430
- };
431
- break;
348
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
432
349
  case "InvalidKMSResourceException":
433
350
  case "com.amazonaws.firehose#InvalidKMSResourceException":
434
- response = {
435
- ...(await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context)),
436
- name: errorCode,
437
- $metadata: deserializeMetadata(output),
438
- };
439
- break;
351
+ throw await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context);
440
352
  case "ResourceNotFoundException":
441
353
  case "com.amazonaws.firehose#ResourceNotFoundException":
442
- response = {
443
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
444
- name: errorCode,
445
- $metadata: deserializeMetadata(output),
446
- };
447
- break;
354
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
448
355
  case "ServiceUnavailableException":
449
356
  case "com.amazonaws.firehose#ServiceUnavailableException":
450
- response = {
451
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
452
- name: errorCode,
453
- $metadata: deserializeMetadata(output),
454
- };
455
- break;
357
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
456
358
  default:
457
359
  const parsedBody = parsedOutput.body;
458
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
459
- response = {
460
- ...parsedBody,
461
- name: `${errorCode}`,
462
- message: parsedBody.message || parsedBody.Message || errorCode,
360
+ response = new FirehoseServiceException_1.FirehoseServiceException({
361
+ name: parsedBody.code || parsedBody.Code || errorCode,
463
362
  $fault: "client",
464
363
  $metadata: deserializeMetadata(output),
465
- };
364
+ });
365
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
466
366
  }
467
- const message = response.message || response.Message || errorCode;
468
- response.message = message;
469
- delete response.Message;
470
- return Promise.reject(Object.assign(new Error(message), response));
471
367
  };
472
368
  const deserializeAws_json1_1PutRecordBatchCommand = async (output, context) => {
473
369
  if (output.statusCode >= 300) {
@@ -494,51 +390,25 @@ const deserializeAws_json1_1PutRecordBatchCommandError = async (output, context)
494
390
  switch (errorCode) {
495
391
  case "InvalidArgumentException":
496
392
  case "com.amazonaws.firehose#InvalidArgumentException":
497
- response = {
498
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
499
- name: errorCode,
500
- $metadata: deserializeMetadata(output),
501
- };
502
- break;
393
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
503
394
  case "InvalidKMSResourceException":
504
395
  case "com.amazonaws.firehose#InvalidKMSResourceException":
505
- response = {
506
- ...(await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context)),
507
- name: errorCode,
508
- $metadata: deserializeMetadata(output),
509
- };
510
- break;
396
+ throw await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context);
511
397
  case "ResourceNotFoundException":
512
398
  case "com.amazonaws.firehose#ResourceNotFoundException":
513
- response = {
514
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
515
- name: errorCode,
516
- $metadata: deserializeMetadata(output),
517
- };
518
- break;
399
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
519
400
  case "ServiceUnavailableException":
520
401
  case "com.amazonaws.firehose#ServiceUnavailableException":
521
- response = {
522
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
523
- name: errorCode,
524
- $metadata: deserializeMetadata(output),
525
- };
526
- break;
402
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
527
403
  default:
528
404
  const parsedBody = parsedOutput.body;
529
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
530
- response = {
531
- ...parsedBody,
532
- name: `${errorCode}`,
533
- message: parsedBody.message || parsedBody.Message || errorCode,
405
+ response = new FirehoseServiceException_1.FirehoseServiceException({
406
+ name: parsedBody.code || parsedBody.Code || errorCode,
534
407
  $fault: "client",
535
408
  $metadata: deserializeMetadata(output),
536
- };
409
+ });
410
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
537
411
  }
538
- const message = response.message || response.Message || errorCode;
539
- response.message = message;
540
- delete response.Message;
541
- return Promise.reject(Object.assign(new Error(message), response));
542
412
  };
543
413
  const deserializeAws_json1_1StartDeliveryStreamEncryptionCommand = async (output, context) => {
544
414
  if (output.statusCode >= 300) {
@@ -565,59 +435,28 @@ const deserializeAws_json1_1StartDeliveryStreamEncryptionCommandError = async (o
565
435
  switch (errorCode) {
566
436
  case "InvalidArgumentException":
567
437
  case "com.amazonaws.firehose#InvalidArgumentException":
568
- response = {
569
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
570
- name: errorCode,
571
- $metadata: deserializeMetadata(output),
572
- };
573
- break;
438
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
574
439
  case "InvalidKMSResourceException":
575
440
  case "com.amazonaws.firehose#InvalidKMSResourceException":
576
- response = {
577
- ...(await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context)),
578
- name: errorCode,
579
- $metadata: deserializeMetadata(output),
580
- };
581
- break;
441
+ throw await deserializeAws_json1_1InvalidKMSResourceExceptionResponse(parsedOutput, context);
582
442
  case "LimitExceededException":
583
443
  case "com.amazonaws.firehose#LimitExceededException":
584
- response = {
585
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
586
- name: errorCode,
587
- $metadata: deserializeMetadata(output),
588
- };
589
- break;
444
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
590
445
  case "ResourceInUseException":
591
446
  case "com.amazonaws.firehose#ResourceInUseException":
592
- response = {
593
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
594
- name: errorCode,
595
- $metadata: deserializeMetadata(output),
596
- };
597
- break;
447
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
598
448
  case "ResourceNotFoundException":
599
449
  case "com.amazonaws.firehose#ResourceNotFoundException":
600
- response = {
601
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
602
- name: errorCode,
603
- $metadata: deserializeMetadata(output),
604
- };
605
- break;
450
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
606
451
  default:
607
452
  const parsedBody = parsedOutput.body;
608
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
609
- response = {
610
- ...parsedBody,
611
- name: `${errorCode}`,
612
- message: parsedBody.message || parsedBody.Message || errorCode,
453
+ response = new FirehoseServiceException_1.FirehoseServiceException({
454
+ name: parsedBody.code || parsedBody.Code || errorCode,
613
455
  $fault: "client",
614
456
  $metadata: deserializeMetadata(output),
615
- };
457
+ });
458
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
616
459
  }
617
- const message = response.message || response.Message || errorCode;
618
- response.message = message;
619
- delete response.Message;
620
- return Promise.reject(Object.assign(new Error(message), response));
621
460
  };
622
461
  const deserializeAws_json1_1StopDeliveryStreamEncryptionCommand = async (output, context) => {
623
462
  if (output.statusCode >= 300) {
@@ -644,51 +483,25 @@ const deserializeAws_json1_1StopDeliveryStreamEncryptionCommandError = async (ou
644
483
  switch (errorCode) {
645
484
  case "InvalidArgumentException":
646
485
  case "com.amazonaws.firehose#InvalidArgumentException":
647
- response = {
648
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
649
- name: errorCode,
650
- $metadata: deserializeMetadata(output),
651
- };
652
- break;
486
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
653
487
  case "LimitExceededException":
654
488
  case "com.amazonaws.firehose#LimitExceededException":
655
- response = {
656
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
657
- name: errorCode,
658
- $metadata: deserializeMetadata(output),
659
- };
660
- break;
489
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
661
490
  case "ResourceInUseException":
662
491
  case "com.amazonaws.firehose#ResourceInUseException":
663
- response = {
664
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
665
- name: errorCode,
666
- $metadata: deserializeMetadata(output),
667
- };
668
- break;
492
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
669
493
  case "ResourceNotFoundException":
670
494
  case "com.amazonaws.firehose#ResourceNotFoundException":
671
- response = {
672
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
673
- name: errorCode,
674
- $metadata: deserializeMetadata(output),
675
- };
676
- break;
495
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
677
496
  default:
678
497
  const parsedBody = parsedOutput.body;
679
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
680
- response = {
681
- ...parsedBody,
682
- name: `${errorCode}`,
683
- message: parsedBody.message || parsedBody.Message || errorCode,
498
+ response = new FirehoseServiceException_1.FirehoseServiceException({
499
+ name: parsedBody.code || parsedBody.Code || errorCode,
684
500
  $fault: "client",
685
501
  $metadata: deserializeMetadata(output),
686
- };
502
+ });
503
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
687
504
  }
688
- const message = response.message || response.Message || errorCode;
689
- response.message = message;
690
- delete response.Message;
691
- return Promise.reject(Object.assign(new Error(message), response));
692
505
  };
693
506
  const deserializeAws_json1_1TagDeliveryStreamCommand = async (output, context) => {
694
507
  if (output.statusCode >= 300) {
@@ -715,51 +528,25 @@ const deserializeAws_json1_1TagDeliveryStreamCommandError = async (output, conte
715
528
  switch (errorCode) {
716
529
  case "InvalidArgumentException":
717
530
  case "com.amazonaws.firehose#InvalidArgumentException":
718
- response = {
719
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
720
- name: errorCode,
721
- $metadata: deserializeMetadata(output),
722
- };
723
- break;
531
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
724
532
  case "LimitExceededException":
725
533
  case "com.amazonaws.firehose#LimitExceededException":
726
- response = {
727
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
728
- name: errorCode,
729
- $metadata: deserializeMetadata(output),
730
- };
731
- break;
534
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
732
535
  case "ResourceInUseException":
733
536
  case "com.amazonaws.firehose#ResourceInUseException":
734
- response = {
735
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
736
- name: errorCode,
737
- $metadata: deserializeMetadata(output),
738
- };
739
- break;
537
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
740
538
  case "ResourceNotFoundException":
741
539
  case "com.amazonaws.firehose#ResourceNotFoundException":
742
- response = {
743
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
744
- name: errorCode,
745
- $metadata: deserializeMetadata(output),
746
- };
747
- break;
540
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
748
541
  default:
749
542
  const parsedBody = parsedOutput.body;
750
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
751
- response = {
752
- ...parsedBody,
753
- name: `${errorCode}`,
754
- message: parsedBody.message || parsedBody.Message || errorCode,
543
+ response = new FirehoseServiceException_1.FirehoseServiceException({
544
+ name: parsedBody.code || parsedBody.Code || errorCode,
755
545
  $fault: "client",
756
546
  $metadata: deserializeMetadata(output),
757
- };
547
+ });
548
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
758
549
  }
759
- const message = response.message || response.Message || errorCode;
760
- response.message = message;
761
- delete response.Message;
762
- return Promise.reject(Object.assign(new Error(message), response));
763
550
  };
764
551
  const deserializeAws_json1_1UntagDeliveryStreamCommand = async (output, context) => {
765
552
  if (output.statusCode >= 300) {
@@ -786,51 +573,25 @@ const deserializeAws_json1_1UntagDeliveryStreamCommandError = async (output, con
786
573
  switch (errorCode) {
787
574
  case "InvalidArgumentException":
788
575
  case "com.amazonaws.firehose#InvalidArgumentException":
789
- response = {
790
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
791
- name: errorCode,
792
- $metadata: deserializeMetadata(output),
793
- };
794
- break;
576
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
795
577
  case "LimitExceededException":
796
578
  case "com.amazonaws.firehose#LimitExceededException":
797
- response = {
798
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
799
- name: errorCode,
800
- $metadata: deserializeMetadata(output),
801
- };
802
- break;
579
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
803
580
  case "ResourceInUseException":
804
581
  case "com.amazonaws.firehose#ResourceInUseException":
805
- response = {
806
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
807
- name: errorCode,
808
- $metadata: deserializeMetadata(output),
809
- };
810
- break;
582
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
811
583
  case "ResourceNotFoundException":
812
584
  case "com.amazonaws.firehose#ResourceNotFoundException":
813
- response = {
814
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
815
- name: errorCode,
816
- $metadata: deserializeMetadata(output),
817
- };
818
- break;
585
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
819
586
  default:
820
587
  const parsedBody = parsedOutput.body;
821
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
822
- response = {
823
- ...parsedBody,
824
- name: `${errorCode}`,
825
- message: parsedBody.message || parsedBody.Message || errorCode,
588
+ response = new FirehoseServiceException_1.FirehoseServiceException({
589
+ name: parsedBody.code || parsedBody.Code || errorCode,
826
590
  $fault: "client",
827
591
  $metadata: deserializeMetadata(output),
828
- };
592
+ });
593
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
829
594
  }
830
- const message = response.message || response.Message || errorCode;
831
- response.message = message;
832
- delete response.Message;
833
- return Promise.reject(Object.assign(new Error(message), response));
834
595
  };
835
596
  const deserializeAws_json1_1UpdateDestinationCommand = async (output, context) => {
836
597
  if (output.statusCode >= 300) {
@@ -857,128 +618,88 @@ const deserializeAws_json1_1UpdateDestinationCommandError = async (output, conte
857
618
  switch (errorCode) {
858
619
  case "ConcurrentModificationException":
859
620
  case "com.amazonaws.firehose#ConcurrentModificationException":
860
- response = {
861
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
862
- name: errorCode,
863
- $metadata: deserializeMetadata(output),
864
- };
865
- break;
621
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
866
622
  case "InvalidArgumentException":
867
623
  case "com.amazonaws.firehose#InvalidArgumentException":
868
- response = {
869
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
870
- name: errorCode,
871
- $metadata: deserializeMetadata(output),
872
- };
873
- break;
624
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
874
625
  case "ResourceInUseException":
875
626
  case "com.amazonaws.firehose#ResourceInUseException":
876
- response = {
877
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
878
- name: errorCode,
879
- $metadata: deserializeMetadata(output),
880
- };
881
- break;
627
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
882
628
  case "ResourceNotFoundException":
883
629
  case "com.amazonaws.firehose#ResourceNotFoundException":
884
- response = {
885
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
886
- name: errorCode,
887
- $metadata: deserializeMetadata(output),
888
- };
889
- break;
630
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
890
631
  default:
891
632
  const parsedBody = parsedOutput.body;
892
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
893
- response = {
894
- ...parsedBody,
895
- name: `${errorCode}`,
896
- message: parsedBody.message || parsedBody.Message || errorCode,
633
+ response = new FirehoseServiceException_1.FirehoseServiceException({
634
+ name: parsedBody.code || parsedBody.Code || errorCode,
897
635
  $fault: "client",
898
636
  $metadata: deserializeMetadata(output),
899
- };
637
+ });
638
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
900
639
  }
901
- const message = response.message || response.Message || errorCode;
902
- response.message = message;
903
- delete response.Message;
904
- return Promise.reject(Object.assign(new Error(message), response));
905
640
  };
906
641
  const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
907
642
  const body = parsedOutput.body;
908
643
  const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
909
- const contents = {
910
- name: "ConcurrentModificationException",
911
- $fault: "client",
644
+ const exception = new models_0_1.ConcurrentModificationException({
912
645
  $metadata: deserializeMetadata(parsedOutput),
913
646
  ...deserialized,
914
- };
915
- return contents;
647
+ });
648
+ return smithy_client_1.decorateServiceException(exception, body);
916
649
  };
917
650
  const deserializeAws_json1_1InvalidArgumentExceptionResponse = async (parsedOutput, context) => {
918
651
  const body = parsedOutput.body;
919
652
  const deserialized = deserializeAws_json1_1InvalidArgumentException(body, context);
920
- const contents = {
921
- name: "InvalidArgumentException",
922
- $fault: "client",
653
+ const exception = new models_0_1.InvalidArgumentException({
923
654
  $metadata: deserializeMetadata(parsedOutput),
924
655
  ...deserialized,
925
- };
926
- return contents;
656
+ });
657
+ return smithy_client_1.decorateServiceException(exception, body);
927
658
  };
928
659
  const deserializeAws_json1_1InvalidKMSResourceExceptionResponse = async (parsedOutput, context) => {
929
660
  const body = parsedOutput.body;
930
661
  const deserialized = deserializeAws_json1_1InvalidKMSResourceException(body, context);
931
- const contents = {
932
- name: "InvalidKMSResourceException",
933
- $fault: "client",
662
+ const exception = new models_0_1.InvalidKMSResourceException({
934
663
  $metadata: deserializeMetadata(parsedOutput),
935
664
  ...deserialized,
936
- };
937
- return contents;
665
+ });
666
+ return smithy_client_1.decorateServiceException(exception, body);
938
667
  };
939
668
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
940
669
  const body = parsedOutput.body;
941
670
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
942
- const contents = {
943
- name: "LimitExceededException",
944
- $fault: "client",
671
+ const exception = new models_0_1.LimitExceededException({
945
672
  $metadata: deserializeMetadata(parsedOutput),
946
673
  ...deserialized,
947
- };
948
- return contents;
674
+ });
675
+ return smithy_client_1.decorateServiceException(exception, body);
949
676
  };
950
677
  const deserializeAws_json1_1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
951
678
  const body = parsedOutput.body;
952
679
  const deserialized = deserializeAws_json1_1ResourceInUseException(body, context);
953
- const contents = {
954
- name: "ResourceInUseException",
955
- $fault: "client",
680
+ const exception = new models_0_1.ResourceInUseException({
956
681
  $metadata: deserializeMetadata(parsedOutput),
957
682
  ...deserialized,
958
- };
959
- return contents;
683
+ });
684
+ return smithy_client_1.decorateServiceException(exception, body);
960
685
  };
961
686
  const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
962
687
  const body = parsedOutput.body;
963
688
  const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
964
- const contents = {
965
- name: "ResourceNotFoundException",
966
- $fault: "client",
689
+ const exception = new models_0_1.ResourceNotFoundException({
967
690
  $metadata: deserializeMetadata(parsedOutput),
968
691
  ...deserialized,
969
- };
970
- return contents;
692
+ });
693
+ return smithy_client_1.decorateServiceException(exception, body);
971
694
  };
972
695
  const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
973
696
  const body = parsedOutput.body;
974
697
  const deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
975
- const contents = {
976
- name: "ServiceUnavailableException",
977
- $fault: "server",
698
+ const exception = new models_0_1.ServiceUnavailableException({
978
699
  $metadata: deserializeMetadata(parsedOutput),
979
700
  ...deserialized,
980
- };
981
- return contents;
701
+ });
702
+ return smithy_client_1.decorateServiceException(exception, body);
982
703
  };
983
704
  const serializeAws_json1_1AmazonopensearchserviceBufferingHints = (input, context) => {
984
705
  return {
@@ -2149,7 +1870,7 @@ const deserializeAws_json1_1DeliveryStreamEncryptionConfiguration = (output, con
2149
1870
  };
2150
1871
  };
2151
1872
  const deserializeAws_json1_1DeliveryStreamNameList = (output, context) => {
2152
- return (output || [])
1873
+ const retVal = (output || [])
2153
1874
  .filter((e) => e != null)
2154
1875
  .map((entry) => {
2155
1876
  if (entry === null) {
@@ -2157,6 +1878,7 @@ const deserializeAws_json1_1DeliveryStreamNameList = (output, context) => {
2157
1878
  }
2158
1879
  return smithy_client_1.expectString(entry);
2159
1880
  });
1881
+ return retVal;
2160
1882
  };
2161
1883
  const deserializeAws_json1_1DescribeDeliveryStreamOutput = (output, context) => {
2162
1884
  return {
@@ -2203,7 +1925,7 @@ const deserializeAws_json1_1DestinationDescription = (output, context) => {
2203
1925
  };
2204
1926
  };
2205
1927
  const deserializeAws_json1_1DestinationDescriptionList = (output, context) => {
2206
- return (output || [])
1928
+ const retVal = (output || [])
2207
1929
  .filter((e) => e != null)
2208
1930
  .map((entry) => {
2209
1931
  if (entry === null) {
@@ -2211,6 +1933,7 @@ const deserializeAws_json1_1DestinationDescriptionList = (output, context) => {
2211
1933
  }
2212
1934
  return deserializeAws_json1_1DestinationDescription(entry, context);
2213
1935
  });
1936
+ return retVal;
2214
1937
  };
2215
1938
  const deserializeAws_json1_1DynamicPartitioningConfiguration = (output, context) => {
2216
1939
  return {
@@ -2325,7 +2048,7 @@ const deserializeAws_json1_1HttpEndpointCommonAttribute = (output, context) => {
2325
2048
  };
2326
2049
  };
2327
2050
  const deserializeAws_json1_1HttpEndpointCommonAttributesList = (output, context) => {
2328
- return (output || [])
2051
+ const retVal = (output || [])
2329
2052
  .filter((e) => e != null)
2330
2053
  .map((entry) => {
2331
2054
  if (entry === null) {
@@ -2333,6 +2056,7 @@ const deserializeAws_json1_1HttpEndpointCommonAttributesList = (output, context)
2333
2056
  }
2334
2057
  return deserializeAws_json1_1HttpEndpointCommonAttribute(entry, context);
2335
2058
  });
2059
+ return retVal;
2336
2060
  };
2337
2061
  const deserializeAws_json1_1HttpEndpointDescription = (output, context) => {
2338
2062
  return {
@@ -2426,7 +2150,7 @@ const deserializeAws_json1_1ListDeliveryStreamsOutput = (output, context) => {
2426
2150
  };
2427
2151
  };
2428
2152
  const deserializeAws_json1_1ListOfNonEmptyStrings = (output, context) => {
2429
- return (output || [])
2153
+ const retVal = (output || [])
2430
2154
  .filter((e) => e != null)
2431
2155
  .map((entry) => {
2432
2156
  if (entry === null) {
@@ -2434,9 +2158,10 @@ const deserializeAws_json1_1ListOfNonEmptyStrings = (output, context) => {
2434
2158
  }
2435
2159
  return smithy_client_1.expectString(entry);
2436
2160
  });
2161
+ return retVal;
2437
2162
  };
2438
2163
  const deserializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace = (output, context) => {
2439
- return (output || [])
2164
+ const retVal = (output || [])
2440
2165
  .filter((e) => e != null)
2441
2166
  .map((entry) => {
2442
2167
  if (entry === null) {
@@ -2444,6 +2169,7 @@ const deserializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace = (output, co
2444
2169
  }
2445
2170
  return smithy_client_1.expectString(entry);
2446
2171
  });
2172
+ return retVal;
2447
2173
  };
2448
2174
  const deserializeAws_json1_1ListTagsForDeliveryStreamOutput = (output, context) => {
2449
2175
  return {
@@ -2454,7 +2180,7 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamOutput = (output, context)
2454
2180
  };
2455
2181
  };
2456
2182
  const deserializeAws_json1_1ListTagsForDeliveryStreamOutputTagList = (output, context) => {
2457
- return (output || [])
2183
+ const retVal = (output || [])
2458
2184
  .filter((e) => e != null)
2459
2185
  .map((entry) => {
2460
2186
  if (entry === null) {
@@ -2462,6 +2188,7 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamOutputTagList = (output, co
2462
2188
  }
2463
2189
  return deserializeAws_json1_1Tag(entry, context);
2464
2190
  });
2191
+ return retVal;
2465
2192
  };
2466
2193
  const deserializeAws_json1_1OpenXJsonSerDe = (output, context) => {
2467
2194
  return {
@@ -2522,7 +2249,7 @@ const deserializeAws_json1_1Processor = (output, context) => {
2522
2249
  };
2523
2250
  };
2524
2251
  const deserializeAws_json1_1ProcessorList = (output, context) => {
2525
- return (output || [])
2252
+ const retVal = (output || [])
2526
2253
  .filter((e) => e != null)
2527
2254
  .map((entry) => {
2528
2255
  if (entry === null) {
@@ -2530,6 +2257,7 @@ const deserializeAws_json1_1ProcessorList = (output, context) => {
2530
2257
  }
2531
2258
  return deserializeAws_json1_1Processor(entry, context);
2532
2259
  });
2260
+ return retVal;
2533
2261
  };
2534
2262
  const deserializeAws_json1_1ProcessorParameter = (output, context) => {
2535
2263
  return {
@@ -2538,7 +2266,7 @@ const deserializeAws_json1_1ProcessorParameter = (output, context) => {
2538
2266
  };
2539
2267
  };
2540
2268
  const deserializeAws_json1_1ProcessorParameterList = (output, context) => {
2541
- return (output || [])
2269
+ const retVal = (output || [])
2542
2270
  .filter((e) => e != null)
2543
2271
  .map((entry) => {
2544
2272
  if (entry === null) {
@@ -2546,6 +2274,7 @@ const deserializeAws_json1_1ProcessorParameterList = (output, context) => {
2546
2274
  }
2547
2275
  return deserializeAws_json1_1ProcessorParameter(entry, context);
2548
2276
  });
2277
+ return retVal;
2549
2278
  };
2550
2279
  const deserializeAws_json1_1PutRecordBatchOutput = (output, context) => {
2551
2280
  return {
@@ -2564,7 +2293,7 @@ const deserializeAws_json1_1PutRecordBatchResponseEntry = (output, context) => {
2564
2293
  };
2565
2294
  };
2566
2295
  const deserializeAws_json1_1PutRecordBatchResponseEntryList = (output, context) => {
2567
- return (output || [])
2296
+ const retVal = (output || [])
2568
2297
  .filter((e) => e != null)
2569
2298
  .map((entry) => {
2570
2299
  if (entry === null) {
@@ -2572,6 +2301,7 @@ const deserializeAws_json1_1PutRecordBatchResponseEntryList = (output, context)
2572
2301
  }
2573
2302
  return deserializeAws_json1_1PutRecordBatchResponseEntry(entry, context);
2574
2303
  });
2304
+ return retVal;
2575
2305
  };
2576
2306
  const deserializeAws_json1_1PutRecordOutput = (output, context) => {
2577
2307
  return {
@@ -2654,7 +2384,7 @@ const deserializeAws_json1_1SchemaConfiguration = (output, context) => {
2654
2384
  };
2655
2385
  };
2656
2386
  const deserializeAws_json1_1SecurityGroupIdList = (output, context) => {
2657
- return (output || [])
2387
+ const retVal = (output || [])
2658
2388
  .filter((e) => e != null)
2659
2389
  .map((entry) => {
2660
2390
  if (entry === null) {
@@ -2662,6 +2392,7 @@ const deserializeAws_json1_1SecurityGroupIdList = (output, context) => {
2662
2392
  }
2663
2393
  return smithy_client_1.expectString(entry);
2664
2394
  });
2395
+ return retVal;
2665
2396
  };
2666
2397
  const deserializeAws_json1_1Serializer = (output, context) => {
2667
2398
  return {
@@ -2718,7 +2449,7 @@ const deserializeAws_json1_1StopDeliveryStreamEncryptionOutput = (output, contex
2718
2449
  return {};
2719
2450
  };
2720
2451
  const deserializeAws_json1_1SubnetIdList = (output, context) => {
2721
- return (output || [])
2452
+ const retVal = (output || [])
2722
2453
  .filter((e) => e != null)
2723
2454
  .map((entry) => {
2724
2455
  if (entry === null) {
@@ -2726,6 +2457,7 @@ const deserializeAws_json1_1SubnetIdList = (output, context) => {
2726
2457
  }
2727
2458
  return smithy_client_1.expectString(entry);
2728
2459
  });
2460
+ return retVal;
2729
2461
  };
2730
2462
  const deserializeAws_json1_1Tag = (output, context) => {
2731
2463
  return {