@aws-sdk/client-codestar-notifications 3.141.0 → 3.142.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.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { CodestarNotificationsServiceException as __BaseException } from "../models/CodestarNotificationsServiceException";
6
6
  import { AccessDeniedException, ConcurrentModificationException, ConfigurationException, InvalidNextTokenException, LimitExceededException, ResourceAlreadyExistsException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
@@ -331,24 +331,23 @@ export var deserializeAws_restJson1CreateNotificationRuleCommand = function (out
331
331
  if (output.statusCode !== 200 && output.statusCode >= 300) {
332
332
  return [2, deserializeAws_restJson1CreateNotificationRuleCommandError(output, context)];
333
333
  }
334
- contents = {
334
+ contents = map({
335
335
  $metadata: deserializeMetadata(output),
336
- Arn: undefined,
337
- };
336
+ });
338
337
  _a = __expectNonNull;
339
338
  _b = __expectObject;
340
339
  return [4, parseBody(output.body, context)];
341
340
  case 1:
342
341
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
343
- if (data.Arn !== undefined && data.Arn !== null) {
342
+ if (data.Arn != null) {
344
343
  contents.Arn = __expectString(data.Arn);
345
344
  }
346
- return [2, Promise.resolve(contents)];
345
+ return [2, contents];
347
346
  }
348
347
  });
349
348
  }); };
350
349
  var deserializeAws_restJson1CreateNotificationRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
351
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
350
+ var parsedOutput, _a, errorCode, _b, parsedBody;
352
351
  var _c;
353
352
  return __generator(this, function (_d) {
354
353
  switch (_d.label) {
@@ -389,14 +388,14 @@ var deserializeAws_restJson1CreateNotificationRuleCommandError = function (outpu
389
388
  case 13: throw _d.sent();
390
389
  case 14:
391
390
  parsedBody = parsedOutput.body;
392
- $metadata = deserializeMetadata(output);
393
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
394
- response = new __BaseException({
395
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
396
- $fault: "client",
397
- $metadata: $metadata,
391
+ throwDefaultError({
392
+ output: output,
393
+ parsedBody: parsedBody,
394
+ exceptionCtor: __BaseException,
395
+ errorCode: errorCode,
398
396
  });
399
- throw __decorateServiceException(response, parsedBody);
397
+ _d.label = 15;
398
+ case 15: return [2];
400
399
  }
401
400
  });
402
401
  }); };
@@ -408,24 +407,23 @@ export var deserializeAws_restJson1DeleteNotificationRuleCommand = function (out
408
407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
409
408
  return [2, deserializeAws_restJson1DeleteNotificationRuleCommandError(output, context)];
410
409
  }
411
- contents = {
410
+ contents = map({
412
411
  $metadata: deserializeMetadata(output),
413
- Arn: undefined,
414
- };
412
+ });
415
413
  _a = __expectNonNull;
416
414
  _b = __expectObject;
417
415
  return [4, parseBody(output.body, context)];
418
416
  case 1:
419
417
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
420
- if (data.Arn !== undefined && data.Arn !== null) {
418
+ if (data.Arn != null) {
421
419
  contents.Arn = __expectString(data.Arn);
422
420
  }
423
- return [2, Promise.resolve(contents)];
421
+ return [2, contents];
424
422
  }
425
423
  });
426
424
  }); };
427
425
  var deserializeAws_restJson1DeleteNotificationRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
428
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
426
+ var parsedOutput, _a, errorCode, _b, parsedBody;
429
427
  var _c;
430
428
  return __generator(this, function (_d) {
431
429
  switch (_d.label) {
@@ -454,14 +452,14 @@ var deserializeAws_restJson1DeleteNotificationRuleCommandError = function (outpu
454
452
  case 7: throw _d.sent();
455
453
  case 8:
456
454
  parsedBody = parsedOutput.body;
457
- $metadata = deserializeMetadata(output);
458
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
459
- response = new __BaseException({
460
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
461
- $fault: "client",
462
- $metadata: $metadata,
455
+ throwDefaultError({
456
+ output: output,
457
+ parsedBody: parsedBody,
458
+ exceptionCtor: __BaseException,
459
+ errorCode: errorCode,
463
460
  });
464
- throw __decorateServiceException(response, parsedBody);
461
+ _d.label = 9;
462
+ case 9: return [2];
465
463
  }
466
464
  });
467
465
  }); };
@@ -473,18 +471,18 @@ export var deserializeAws_restJson1DeleteTargetCommand = function (output, conte
473
471
  if (output.statusCode !== 200 && output.statusCode >= 300) {
474
472
  return [2, deserializeAws_restJson1DeleteTargetCommandError(output, context)];
475
473
  }
476
- contents = {
474
+ contents = map({
477
475
  $metadata: deserializeMetadata(output),
478
- };
476
+ });
479
477
  return [4, collectBody(output.body, context)];
480
478
  case 1:
481
479
  _a.sent();
482
- return [2, Promise.resolve(contents)];
480
+ return [2, contents];
483
481
  }
484
482
  });
485
483
  }); };
486
484
  var deserializeAws_restJson1DeleteTargetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
487
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
485
+ var parsedOutput, _a, errorCode, _b, parsedBody;
488
486
  var _c;
489
487
  return __generator(this, function (_d) {
490
488
  switch (_d.label) {
@@ -505,14 +503,14 @@ var deserializeAws_restJson1DeleteTargetCommandError = function (output, context
505
503
  case 3: throw _d.sent();
506
504
  case 4:
507
505
  parsedBody = parsedOutput.body;
508
- $metadata = deserializeMetadata(output);
509
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
510
- response = new __BaseException({
511
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
512
- $fault: "client",
513
- $metadata: $metadata,
506
+ throwDefaultError({
507
+ output: output,
508
+ parsedBody: parsedBody,
509
+ exceptionCtor: __BaseException,
510
+ errorCode: errorCode,
514
511
  });
515
- throw __decorateServiceException(response, parsedBody);
512
+ _d.label = 5;
513
+ case 5: return [2];
516
514
  }
517
515
  });
518
516
  }); };
@@ -524,64 +522,53 @@ export var deserializeAws_restJson1DescribeNotificationRuleCommand = function (o
524
522
  if (output.statusCode !== 200 && output.statusCode >= 300) {
525
523
  return [2, deserializeAws_restJson1DescribeNotificationRuleCommandError(output, context)];
526
524
  }
527
- contents = {
525
+ contents = map({
528
526
  $metadata: deserializeMetadata(output),
529
- Arn: undefined,
530
- CreatedBy: undefined,
531
- CreatedTimestamp: undefined,
532
- DetailType: undefined,
533
- EventTypes: undefined,
534
- LastModifiedTimestamp: undefined,
535
- Name: undefined,
536
- Resource: undefined,
537
- Status: undefined,
538
- Tags: undefined,
539
- Targets: undefined,
540
- };
527
+ });
541
528
  _a = __expectNonNull;
542
529
  _b = __expectObject;
543
530
  return [4, parseBody(output.body, context)];
544
531
  case 1:
545
532
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
546
- if (data.Arn !== undefined && data.Arn !== null) {
533
+ if (data.Arn != null) {
547
534
  contents.Arn = __expectString(data.Arn);
548
535
  }
549
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
536
+ if (data.CreatedBy != null) {
550
537
  contents.CreatedBy = __expectString(data.CreatedBy);
551
538
  }
552
- if (data.CreatedTimestamp !== undefined && data.CreatedTimestamp !== null) {
539
+ if (data.CreatedTimestamp != null) {
553
540
  contents.CreatedTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreatedTimestamp)));
554
541
  }
555
- if (data.DetailType !== undefined && data.DetailType !== null) {
542
+ if (data.DetailType != null) {
556
543
  contents.DetailType = __expectString(data.DetailType);
557
544
  }
558
- if (data.EventTypes !== undefined && data.EventTypes !== null) {
545
+ if (data.EventTypes != null) {
559
546
  contents.EventTypes = deserializeAws_restJson1EventTypeBatch(data.EventTypes, context);
560
547
  }
561
- if (data.LastModifiedTimestamp !== undefined && data.LastModifiedTimestamp !== null) {
548
+ if (data.LastModifiedTimestamp != null) {
562
549
  contents.LastModifiedTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTimestamp)));
563
550
  }
564
- if (data.Name !== undefined && data.Name !== null) {
551
+ if (data.Name != null) {
565
552
  contents.Name = __expectString(data.Name);
566
553
  }
567
- if (data.Resource !== undefined && data.Resource !== null) {
554
+ if (data.Resource != null) {
568
555
  contents.Resource = __expectString(data.Resource);
569
556
  }
570
- if (data.Status !== undefined && data.Status !== null) {
557
+ if (data.Status != null) {
571
558
  contents.Status = __expectString(data.Status);
572
559
  }
573
- if (data.Tags !== undefined && data.Tags !== null) {
560
+ if (data.Tags != null) {
574
561
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
575
562
  }
576
- if (data.Targets !== undefined && data.Targets !== null) {
563
+ if (data.Targets != null) {
577
564
  contents.Targets = deserializeAws_restJson1TargetsBatch(data.Targets, context);
578
565
  }
579
- return [2, Promise.resolve(contents)];
566
+ return [2, contents];
580
567
  }
581
568
  });
582
569
  }); };
583
570
  var deserializeAws_restJson1DescribeNotificationRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
584
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
571
+ var parsedOutput, _a, errorCode, _b, parsedBody;
585
572
  var _c;
586
573
  return __generator(this, function (_d) {
587
574
  switch (_d.label) {
@@ -606,14 +593,14 @@ var deserializeAws_restJson1DescribeNotificationRuleCommandError = function (out
606
593
  case 5: throw _d.sent();
607
594
  case 6:
608
595
  parsedBody = parsedOutput.body;
609
- $metadata = deserializeMetadata(output);
610
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
611
- response = new __BaseException({
612
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
613
- $fault: "client",
614
- $metadata: $metadata,
596
+ throwDefaultError({
597
+ output: output,
598
+ parsedBody: parsedBody,
599
+ exceptionCtor: __BaseException,
600
+ errorCode: errorCode,
615
601
  });
616
- throw __decorateServiceException(response, parsedBody);
602
+ _d.label = 7;
603
+ case 7: return [2];
617
604
  }
618
605
  });
619
606
  }); };
@@ -625,28 +612,26 @@ export var deserializeAws_restJson1ListEventTypesCommand = function (output, con
625
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
626
613
  return [2, deserializeAws_restJson1ListEventTypesCommandError(output, context)];
627
614
  }
628
- contents = {
615
+ contents = map({
629
616
  $metadata: deserializeMetadata(output),
630
- EventTypes: undefined,
631
- NextToken: undefined,
632
- };
617
+ });
633
618
  _a = __expectNonNull;
634
619
  _b = __expectObject;
635
620
  return [4, parseBody(output.body, context)];
636
621
  case 1:
637
622
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
638
- if (data.EventTypes !== undefined && data.EventTypes !== null) {
623
+ if (data.EventTypes != null) {
639
624
  contents.EventTypes = deserializeAws_restJson1EventTypeBatch(data.EventTypes, context);
640
625
  }
641
- if (data.NextToken !== undefined && data.NextToken !== null) {
626
+ if (data.NextToken != null) {
642
627
  contents.NextToken = __expectString(data.NextToken);
643
628
  }
644
- return [2, Promise.resolve(contents)];
629
+ return [2, contents];
645
630
  }
646
631
  });
647
632
  }); };
648
633
  var deserializeAws_restJson1ListEventTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
649
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
634
+ var parsedOutput, _a, errorCode, _b, parsedBody;
650
635
  var _c;
651
636
  return __generator(this, function (_d) {
652
637
  switch (_d.label) {
@@ -671,14 +656,14 @@ var deserializeAws_restJson1ListEventTypesCommandError = function (output, conte
671
656
  case 5: throw _d.sent();
672
657
  case 6:
673
658
  parsedBody = parsedOutput.body;
674
- $metadata = deserializeMetadata(output);
675
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
676
- response = new __BaseException({
677
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
678
- $fault: "client",
679
- $metadata: $metadata,
659
+ throwDefaultError({
660
+ output: output,
661
+ parsedBody: parsedBody,
662
+ exceptionCtor: __BaseException,
663
+ errorCode: errorCode,
680
664
  });
681
- throw __decorateServiceException(response, parsedBody);
665
+ _d.label = 7;
666
+ case 7: return [2];
682
667
  }
683
668
  });
684
669
  }); };
@@ -690,28 +675,26 @@ export var deserializeAws_restJson1ListNotificationRulesCommand = function (outp
690
675
  if (output.statusCode !== 200 && output.statusCode >= 300) {
691
676
  return [2, deserializeAws_restJson1ListNotificationRulesCommandError(output, context)];
692
677
  }
693
- contents = {
678
+ contents = map({
694
679
  $metadata: deserializeMetadata(output),
695
- NextToken: undefined,
696
- NotificationRules: undefined,
697
- };
680
+ });
698
681
  _a = __expectNonNull;
699
682
  _b = __expectObject;
700
683
  return [4, parseBody(output.body, context)];
701
684
  case 1:
702
685
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
703
- if (data.NextToken !== undefined && data.NextToken !== null) {
686
+ if (data.NextToken != null) {
704
687
  contents.NextToken = __expectString(data.NextToken);
705
688
  }
706
- if (data.NotificationRules !== undefined && data.NotificationRules !== null) {
689
+ if (data.NotificationRules != null) {
707
690
  contents.NotificationRules = deserializeAws_restJson1NotificationRuleBatch(data.NotificationRules, context);
708
691
  }
709
- return [2, Promise.resolve(contents)];
692
+ return [2, contents];
710
693
  }
711
694
  });
712
695
  }); };
713
696
  var deserializeAws_restJson1ListNotificationRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
714
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
697
+ var parsedOutput, _a, errorCode, _b, parsedBody;
715
698
  var _c;
716
699
  return __generator(this, function (_d) {
717
700
  switch (_d.label) {
@@ -736,14 +719,14 @@ var deserializeAws_restJson1ListNotificationRulesCommandError = function (output
736
719
  case 5: throw _d.sent();
737
720
  case 6:
738
721
  parsedBody = parsedOutput.body;
739
- $metadata = deserializeMetadata(output);
740
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
741
- response = new __BaseException({
742
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
743
- $fault: "client",
744
- $metadata: $metadata,
722
+ throwDefaultError({
723
+ output: output,
724
+ parsedBody: parsedBody,
725
+ exceptionCtor: __BaseException,
726
+ errorCode: errorCode,
745
727
  });
746
- throw __decorateServiceException(response, parsedBody);
728
+ _d.label = 7;
729
+ case 7: return [2];
747
730
  }
748
731
  });
749
732
  }); };
@@ -755,24 +738,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
755
738
  if (output.statusCode !== 200 && output.statusCode >= 300) {
756
739
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
757
740
  }
758
- contents = {
741
+ contents = map({
759
742
  $metadata: deserializeMetadata(output),
760
- Tags: undefined,
761
- };
743
+ });
762
744
  _a = __expectNonNull;
763
745
  _b = __expectObject;
764
746
  return [4, parseBody(output.body, context)];
765
747
  case 1:
766
748
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
767
- if (data.Tags !== undefined && data.Tags !== null) {
749
+ if (data.Tags != null) {
768
750
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
769
751
  }
770
- return [2, Promise.resolve(contents)];
752
+ return [2, contents];
771
753
  }
772
754
  });
773
755
  }); };
774
756
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
775
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
757
+ var parsedOutput, _a, errorCode, _b, parsedBody;
776
758
  var _c;
777
759
  return __generator(this, function (_d) {
778
760
  switch (_d.label) {
@@ -797,14 +779,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
797
779
  case 5: throw _d.sent();
798
780
  case 6:
799
781
  parsedBody = parsedOutput.body;
800
- $metadata = deserializeMetadata(output);
801
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
802
- response = new __BaseException({
803
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
804
- $fault: "client",
805
- $metadata: $metadata,
782
+ throwDefaultError({
783
+ output: output,
784
+ parsedBody: parsedBody,
785
+ exceptionCtor: __BaseException,
786
+ errorCode: errorCode,
806
787
  });
807
- throw __decorateServiceException(response, parsedBody);
788
+ _d.label = 7;
789
+ case 7: return [2];
808
790
  }
809
791
  });
810
792
  }); };
@@ -816,28 +798,26 @@ export var deserializeAws_restJson1ListTargetsCommand = function (output, contex
816
798
  if (output.statusCode !== 200 && output.statusCode >= 300) {
817
799
  return [2, deserializeAws_restJson1ListTargetsCommandError(output, context)];
818
800
  }
819
- contents = {
801
+ contents = map({
820
802
  $metadata: deserializeMetadata(output),
821
- NextToken: undefined,
822
- Targets: undefined,
823
- };
803
+ });
824
804
  _a = __expectNonNull;
825
805
  _b = __expectObject;
826
806
  return [4, parseBody(output.body, context)];
827
807
  case 1:
828
808
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
829
- if (data.NextToken !== undefined && data.NextToken !== null) {
809
+ if (data.NextToken != null) {
830
810
  contents.NextToken = __expectString(data.NextToken);
831
811
  }
832
- if (data.Targets !== undefined && data.Targets !== null) {
812
+ if (data.Targets != null) {
833
813
  contents.Targets = deserializeAws_restJson1TargetsBatch(data.Targets, context);
834
814
  }
835
- return [2, Promise.resolve(contents)];
815
+ return [2, contents];
836
816
  }
837
817
  });
838
818
  }); };
839
819
  var deserializeAws_restJson1ListTargetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
840
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
820
+ var parsedOutput, _a, errorCode, _b, parsedBody;
841
821
  var _c;
842
822
  return __generator(this, function (_d) {
843
823
  switch (_d.label) {
@@ -862,14 +842,14 @@ var deserializeAws_restJson1ListTargetsCommandError = function (output, context)
862
842
  case 5: throw _d.sent();
863
843
  case 6:
864
844
  parsedBody = parsedOutput.body;
865
- $metadata = deserializeMetadata(output);
866
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
867
- response = new __BaseException({
868
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
869
- $fault: "client",
870
- $metadata: $metadata,
845
+ throwDefaultError({
846
+ output: output,
847
+ parsedBody: parsedBody,
848
+ exceptionCtor: __BaseException,
849
+ errorCode: errorCode,
871
850
  });
872
- throw __decorateServiceException(response, parsedBody);
851
+ _d.label = 7;
852
+ case 7: return [2];
873
853
  }
874
854
  });
875
855
  }); };
@@ -881,24 +861,23 @@ export var deserializeAws_restJson1SubscribeCommand = function (output, context)
881
861
  if (output.statusCode !== 200 && output.statusCode >= 300) {
882
862
  return [2, deserializeAws_restJson1SubscribeCommandError(output, context)];
883
863
  }
884
- contents = {
864
+ contents = map({
885
865
  $metadata: deserializeMetadata(output),
886
- Arn: undefined,
887
- };
866
+ });
888
867
  _a = __expectNonNull;
889
868
  _b = __expectObject;
890
869
  return [4, parseBody(output.body, context)];
891
870
  case 1:
892
871
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
893
- if (data.Arn !== undefined && data.Arn !== null) {
872
+ if (data.Arn != null) {
894
873
  contents.Arn = __expectString(data.Arn);
895
874
  }
896
- return [2, Promise.resolve(contents)];
875
+ return [2, contents];
897
876
  }
898
877
  });
899
878
  }); };
900
879
  var deserializeAws_restJson1SubscribeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
901
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
880
+ var parsedOutput, _a, errorCode, _b, parsedBody;
902
881
  var _c;
903
882
  return __generator(this, function (_d) {
904
883
  switch (_d.label) {
@@ -923,14 +902,14 @@ var deserializeAws_restJson1SubscribeCommandError = function (output, context) {
923
902
  case 5: throw _d.sent();
924
903
  case 6:
925
904
  parsedBody = parsedOutput.body;
926
- $metadata = deserializeMetadata(output);
927
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
928
- response = new __BaseException({
929
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
930
- $fault: "client",
931
- $metadata: $metadata,
905
+ throwDefaultError({
906
+ output: output,
907
+ parsedBody: parsedBody,
908
+ exceptionCtor: __BaseException,
909
+ errorCode: errorCode,
932
910
  });
933
- throw __decorateServiceException(response, parsedBody);
911
+ _d.label = 7;
912
+ case 7: return [2];
934
913
  }
935
914
  });
936
915
  }); };
@@ -942,24 +921,23 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
942
921
  if (output.statusCode !== 200 && output.statusCode >= 300) {
943
922
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
944
923
  }
945
- contents = {
924
+ contents = map({
946
925
  $metadata: deserializeMetadata(output),
947
- Tags: undefined,
948
- };
926
+ });
949
927
  _a = __expectNonNull;
950
928
  _b = __expectObject;
951
929
  return [4, parseBody(output.body, context)];
952
930
  case 1:
953
931
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
954
- if (data.Tags !== undefined && data.Tags !== null) {
932
+ if (data.Tags != null) {
955
933
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
956
934
  }
957
- return [2, Promise.resolve(contents)];
935
+ return [2, contents];
958
936
  }
959
937
  });
960
938
  }); };
961
939
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
962
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
940
+ var parsedOutput, _a, errorCode, _b, parsedBody;
963
941
  var _c;
964
942
  return __generator(this, function (_d) {
965
943
  switch (_d.label) {
@@ -988,14 +966,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
988
966
  case 7: throw _d.sent();
989
967
  case 8:
990
968
  parsedBody = parsedOutput.body;
991
- $metadata = deserializeMetadata(output);
992
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
993
- response = new __BaseException({
994
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
995
- $fault: "client",
996
- $metadata: $metadata,
969
+ throwDefaultError({
970
+ output: output,
971
+ parsedBody: parsedBody,
972
+ exceptionCtor: __BaseException,
973
+ errorCode: errorCode,
997
974
  });
998
- throw __decorateServiceException(response, parsedBody);
975
+ _d.label = 9;
976
+ case 9: return [2];
999
977
  }
1000
978
  });
1001
979
  }); };
@@ -1007,24 +985,23 @@ export var deserializeAws_restJson1UnsubscribeCommand = function (output, contex
1007
985
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1008
986
  return [2, deserializeAws_restJson1UnsubscribeCommandError(output, context)];
1009
987
  }
1010
- contents = {
988
+ contents = map({
1011
989
  $metadata: deserializeMetadata(output),
1012
- Arn: undefined,
1013
- };
990
+ });
1014
991
  _a = __expectNonNull;
1015
992
  _b = __expectObject;
1016
993
  return [4, parseBody(output.body, context)];
1017
994
  case 1:
1018
995
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1019
- if (data.Arn !== undefined && data.Arn !== null) {
996
+ if (data.Arn != null) {
1020
997
  contents.Arn = __expectString(data.Arn);
1021
998
  }
1022
- return [2, Promise.resolve(contents)];
999
+ return [2, contents];
1023
1000
  }
1024
1001
  });
1025
1002
  }); };
1026
1003
  var deserializeAws_restJson1UnsubscribeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1027
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1004
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1028
1005
  var _c;
1029
1006
  return __generator(this, function (_d) {
1030
1007
  switch (_d.label) {
@@ -1045,14 +1022,14 @@ var deserializeAws_restJson1UnsubscribeCommandError = function (output, context)
1045
1022
  case 3: throw _d.sent();
1046
1023
  case 4:
1047
1024
  parsedBody = parsedOutput.body;
1048
- $metadata = deserializeMetadata(output);
1049
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1050
- response = new __BaseException({
1051
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1052
- $fault: "client",
1053
- $metadata: $metadata,
1025
+ throwDefaultError({
1026
+ output: output,
1027
+ parsedBody: parsedBody,
1028
+ exceptionCtor: __BaseException,
1029
+ errorCode: errorCode,
1054
1030
  });
1055
- throw __decorateServiceException(response, parsedBody);
1031
+ _d.label = 5;
1032
+ case 5: return [2];
1056
1033
  }
1057
1034
  });
1058
1035
  }); };
@@ -1064,18 +1041,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1064
1041
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1065
1042
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1066
1043
  }
1067
- contents = {
1044
+ contents = map({
1068
1045
  $metadata: deserializeMetadata(output),
1069
- };
1046
+ });
1070
1047
  return [4, collectBody(output.body, context)];
1071
1048
  case 1:
1072
1049
  _a.sent();
1073
- return [2, Promise.resolve(contents)];
1050
+ return [2, contents];
1074
1051
  }
1075
1052
  });
1076
1053
  }); };
1077
1054
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1078
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1055
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1079
1056
  var _c;
1080
1057
  return __generator(this, function (_d) {
1081
1058
  switch (_d.label) {
@@ -1104,14 +1081,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1104
1081
  case 7: throw _d.sent();
1105
1082
  case 8:
1106
1083
  parsedBody = parsedOutput.body;
1107
- $metadata = deserializeMetadata(output);
1108
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1109
- response = new __BaseException({
1110
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1111
- $fault: "client",
1112
- $metadata: $metadata,
1084
+ throwDefaultError({
1085
+ output: output,
1086
+ parsedBody: parsedBody,
1087
+ exceptionCtor: __BaseException,
1088
+ errorCode: errorCode,
1113
1089
  });
1114
- throw __decorateServiceException(response, parsedBody);
1090
+ _d.label = 9;
1091
+ case 9: return [2];
1115
1092
  }
1116
1093
  });
1117
1094
  }); };
@@ -1123,18 +1100,18 @@ export var deserializeAws_restJson1UpdateNotificationRuleCommand = function (out
1123
1100
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1124
1101
  return [2, deserializeAws_restJson1UpdateNotificationRuleCommandError(output, context)];
1125
1102
  }
1126
- contents = {
1103
+ contents = map({
1127
1104
  $metadata: deserializeMetadata(output),
1128
- };
1105
+ });
1129
1106
  return [4, collectBody(output.body, context)];
1130
1107
  case 1:
1131
1108
  _a.sent();
1132
- return [2, Promise.resolve(contents)];
1109
+ return [2, contents];
1133
1110
  }
1134
1111
  });
1135
1112
  }); };
1136
1113
  var deserializeAws_restJson1UpdateNotificationRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1137
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1114
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1138
1115
  var _c;
1139
1116
  return __generator(this, function (_d) {
1140
1117
  switch (_d.label) {
@@ -1159,23 +1136,24 @@ var deserializeAws_restJson1UpdateNotificationRuleCommandError = function (outpu
1159
1136
  case 5: throw _d.sent();
1160
1137
  case 6:
1161
1138
  parsedBody = parsedOutput.body;
1162
- $metadata = deserializeMetadata(output);
1163
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1164
- response = new __BaseException({
1165
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1166
- $fault: "client",
1167
- $metadata: $metadata,
1139
+ throwDefaultError({
1140
+ output: output,
1141
+ parsedBody: parsedBody,
1142
+ exceptionCtor: __BaseException,
1143
+ errorCode: errorCode,
1168
1144
  });
1169
- throw __decorateServiceException(response, parsedBody);
1145
+ _d.label = 7;
1146
+ case 7: return [2];
1170
1147
  }
1171
1148
  });
1172
1149
  }); };
1150
+ var map = __map;
1173
1151
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1174
1152
  var contents, data, exception;
1175
1153
  return __generator(this, function (_a) {
1176
- contents = {};
1154
+ contents = map({});
1177
1155
  data = parsedOutput.body;
1178
- if (data.Message !== undefined && data.Message !== null) {
1156
+ if (data.Message != null) {
1179
1157
  contents.Message = __expectString(data.Message);
1180
1158
  }
1181
1159
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1185,9 +1163,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1185
1163
  var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1186
1164
  var contents, data, exception;
1187
1165
  return __generator(this, function (_a) {
1188
- contents = {};
1166
+ contents = map({});
1189
1167
  data = parsedOutput.body;
1190
- if (data.Message !== undefined && data.Message !== null) {
1168
+ if (data.Message != null) {
1191
1169
  contents.Message = __expectString(data.Message);
1192
1170
  }
1193
1171
  exception = new ConcurrentModificationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1197,9 +1175,9 @@ var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (
1197
1175
  var deserializeAws_restJson1ConfigurationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1198
1176
  var contents, data, exception;
1199
1177
  return __generator(this, function (_a) {
1200
- contents = {};
1178
+ contents = map({});
1201
1179
  data = parsedOutput.body;
1202
- if (data.Message !== undefined && data.Message !== null) {
1180
+ if (data.Message != null) {
1203
1181
  contents.Message = __expectString(data.Message);
1204
1182
  }
1205
1183
  exception = new ConfigurationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1209,9 +1187,9 @@ var deserializeAws_restJson1ConfigurationExceptionResponse = function (parsedOut
1209
1187
  var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1210
1188
  var contents, data, exception;
1211
1189
  return __generator(this, function (_a) {
1212
- contents = {};
1190
+ contents = map({});
1213
1191
  data = parsedOutput.body;
1214
- if (data.Message !== undefined && data.Message !== null) {
1192
+ if (data.Message != null) {
1215
1193
  contents.Message = __expectString(data.Message);
1216
1194
  }
1217
1195
  exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1221,9 +1199,9 @@ var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsed
1221
1199
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1222
1200
  var contents, data, exception;
1223
1201
  return __generator(this, function (_a) {
1224
- contents = {};
1202
+ contents = map({});
1225
1203
  data = parsedOutput.body;
1226
- if (data.Message !== undefined && data.Message !== null) {
1204
+ if (data.Message != null) {
1227
1205
  contents.Message = __expectString(data.Message);
1228
1206
  }
1229
1207
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1233,9 +1211,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
1233
1211
  var deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1234
1212
  var contents, data, exception;
1235
1213
  return __generator(this, function (_a) {
1236
- contents = {};
1214
+ contents = map({});
1237
1215
  data = parsedOutput.body;
1238
- if (data.Message !== undefined && data.Message !== null) {
1216
+ if (data.Message != null) {
1239
1217
  contents.Message = __expectString(data.Message);
1240
1218
  }
1241
1219
  exception = new ResourceAlreadyExistsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1245,9 +1223,9 @@ var deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = function (p
1245
1223
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1246
1224
  var contents, data, exception;
1247
1225
  return __generator(this, function (_a) {
1248
- contents = {};
1226
+ contents = map({});
1249
1227
  data = parsedOutput.body;
1250
- if (data.Message !== undefined && data.Message !== null) {
1228
+ if (data.Message != null) {
1251
1229
  contents.Message = __expectString(data.Message);
1252
1230
  }
1253
1231
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1257,9 +1235,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1257
1235
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1258
1236
  var contents, data, exception;
1259
1237
  return __generator(this, function (_a) {
1260
- contents = {};
1238
+ contents = map({});
1261
1239
  data = parsedOutput.body;
1262
- if (data.Message !== undefined && data.Message !== null) {
1240
+ if (data.Message != null) {
1263
1241
  contents.Message = __expectString(data.Message);
1264
1242
  }
1265
1243
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1270,9 +1248,6 @@ var serializeAws_restJson1EventTypeIds = function (input, context) {
1270
1248
  return input
1271
1249
  .filter(function (e) { return e != null; })
1272
1250
  .map(function (entry) {
1273
- if (entry === null) {
1274
- return null;
1275
- }
1276
1251
  return entry;
1277
1252
  });
1278
1253
  };
@@ -1283,9 +1258,6 @@ var serializeAws_restJson1ListEventTypesFilters = function (input, context) {
1283
1258
  return input
1284
1259
  .filter(function (e) { return e != null; })
1285
1260
  .map(function (entry) {
1286
- if (entry === null) {
1287
- return null;
1288
- }
1289
1261
  return serializeAws_restJson1ListEventTypesFilter(entry, context);
1290
1262
  });
1291
1263
  };
@@ -1296,9 +1268,6 @@ var serializeAws_restJson1ListNotificationRulesFilters = function (input, contex
1296
1268
  return input
1297
1269
  .filter(function (e) { return e != null; })
1298
1270
  .map(function (entry) {
1299
- if (entry === null) {
1300
- return null;
1301
- }
1302
1271
  return serializeAws_restJson1ListNotificationRulesFilter(entry, context);
1303
1272
  });
1304
1273
  };
@@ -1309,9 +1278,6 @@ var serializeAws_restJson1ListTargetsFilters = function (input, context) {
1309
1278
  return input
1310
1279
  .filter(function (e) { return e != null; })
1311
1280
  .map(function (entry) {
1312
- if (entry === null) {
1313
- return null;
1314
- }
1315
1281
  return serializeAws_restJson1ListTargetsFilter(entry, context);
1316
1282
  });
1317
1283
  };
@@ -1319,9 +1285,6 @@ var serializeAws_restJson1TagKeys = function (input, context) {
1319
1285
  return input
1320
1286
  .filter(function (e) { return e != null; })
1321
1287
  .map(function (entry) {
1322
- if (entry === null) {
1323
- return null;
1324
- }
1325
1288
  return entry;
1326
1289
  });
1327
1290
  };
@@ -1342,9 +1305,6 @@ var serializeAws_restJson1Targets = function (input, context) {
1342
1305
  return input
1343
1306
  .filter(function (e) { return e != null; })
1344
1307
  .map(function (entry) {
1345
- if (entry === null) {
1346
- return null;
1347
- }
1348
1308
  return serializeAws_restJson1Target(entry, context);
1349
1309
  });
1350
1310
  };