@aws-sdk/client-ivs 3.141.0 → 3.149.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, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { IvsServiceException as __BaseException } from "../models/IvsServiceException";
5
5
  import { AccessDeniedException, ChannelNotBroadcasting, ConflictException, InternalServerException, PendingVerification, ResourceNotFoundException, ServiceQuotaExceededException, StreamUnavailable, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1BatchGetChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -538,7 +538,7 @@ export var serializeAws_restJson1ListStreamSessionsCommand = function (input, co
538
538
  });
539
539
  }); };
540
540
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
541
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
541
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
542
542
  return __generator(this, function (_c) {
543
543
  switch (_c.label) {
544
544
  case 0: return [4, context.endpoint()];
@@ -546,16 +546,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
546
546
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
547
547
  headers = {};
548
548
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
549
- if (input.resourceArn !== undefined) {
550
- labelValue = input.resourceArn;
551
- if (labelValue.length <= 0) {
552
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
553
- }
554
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
555
- }
556
- else {
557
- throw new Error("No value provided for input HTTP label: resourceArn.");
558
- }
549
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
559
550
  return [2, new __HttpRequest({
560
551
  protocol: protocol,
561
552
  hostname: hostname,
@@ -617,7 +608,7 @@ export var serializeAws_restJson1StopStreamCommand = function (input, context) {
617
608
  });
618
609
  }); };
619
610
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
620
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
611
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
621
612
  return __generator(this, function (_c) {
622
613
  switch (_c.label) {
623
614
  case 0: return [4, context.endpoint()];
@@ -627,16 +618,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
627
618
  "content-type": "application/json",
628
619
  };
629
620
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
630
- if (input.resourceArn !== undefined) {
631
- labelValue = input.resourceArn;
632
- if (labelValue.length <= 0) {
633
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
634
- }
635
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
636
- }
637
- else {
638
- throw new Error("No value provided for input HTTP label: resourceArn.");
639
- }
621
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
640
622
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
641
623
  return [2, new __HttpRequest({
642
624
  protocol: protocol,
@@ -651,7 +633,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
651
633
  });
652
634
  }); };
653
635
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
654
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
636
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
655
637
  return __generator(this, function (_c) {
656
638
  switch (_c.label) {
657
639
  case 0: return [4, context.endpoint()];
@@ -659,17 +641,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
659
641
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
660
642
  headers = {};
661
643
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
662
- if (input.resourceArn !== undefined) {
663
- labelValue = input.resourceArn;
664
- if (labelValue.length <= 0) {
665
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
666
- }
667
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
668
- }
669
- else {
670
- throw new Error("No value provided for input HTTP label: resourceArn.");
671
- }
672
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
644
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
645
+ query = map({
646
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
647
+ });
673
648
  return [2, new __HttpRequest({
674
649
  protocol: protocol,
675
650
  hostname: hostname,
@@ -715,28 +690,26 @@ export var deserializeAws_restJson1BatchGetChannelCommand = function (output, co
715
690
  if (output.statusCode !== 200 && output.statusCode >= 300) {
716
691
  return [2, deserializeAws_restJson1BatchGetChannelCommandError(output, context)];
717
692
  }
718
- contents = {
693
+ contents = map({
719
694
  $metadata: deserializeMetadata(output),
720
- channels: undefined,
721
- errors: undefined,
722
- };
695
+ });
723
696
  _a = __expectNonNull;
724
697
  _b = __expectObject;
725
698
  return [4, parseBody(output.body, context)];
726
699
  case 1:
727
700
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
728
- if (data.channels !== undefined && data.channels !== null) {
701
+ if (data.channels != null) {
729
702
  contents.channels = deserializeAws_restJson1Channels(data.channels, context);
730
703
  }
731
- if (data.errors !== undefined && data.errors !== null) {
704
+ if (data.errors != null) {
732
705
  contents.errors = deserializeAws_restJson1BatchErrors(data.errors, context);
733
706
  }
734
- return [2, Promise.resolve(contents)];
707
+ return [2, contents];
735
708
  }
736
709
  });
737
710
  }); };
738
711
  var deserializeAws_restJson1BatchGetChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
739
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
712
+ var parsedOutput, _a, errorCode, parsedBody;
740
713
  var _b;
741
714
  return __generator(this, function (_c) {
742
715
  switch (_c.label) {
@@ -747,18 +720,13 @@ var deserializeAws_restJson1BatchGetChannelCommandError = function (output, cont
747
720
  case 1:
748
721
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
749
722
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
750
- switch (errorCode) {
751
- default:
752
- parsedBody = parsedOutput.body;
753
- $metadata = deserializeMetadata(output);
754
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
755
- response = new __BaseException({
756
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
757
- $fault: "client",
758
- $metadata: $metadata,
759
- });
760
- throw __decorateServiceException(response, parsedBody);
761
- }
723
+ parsedBody = parsedOutput.body;
724
+ throwDefaultError({
725
+ output: output,
726
+ parsedBody: parsedBody,
727
+ exceptionCtor: __BaseException,
728
+ errorCode: errorCode,
729
+ });
762
730
  return [2];
763
731
  }
764
732
  });
@@ -771,28 +739,26 @@ export var deserializeAws_restJson1BatchGetStreamKeyCommand = function (output,
771
739
  if (output.statusCode !== 200 && output.statusCode >= 300) {
772
740
  return [2, deserializeAws_restJson1BatchGetStreamKeyCommandError(output, context)];
773
741
  }
774
- contents = {
742
+ contents = map({
775
743
  $metadata: deserializeMetadata(output),
776
- errors: undefined,
777
- streamKeys: undefined,
778
- };
744
+ });
779
745
  _a = __expectNonNull;
780
746
  _b = __expectObject;
781
747
  return [4, parseBody(output.body, context)];
782
748
  case 1:
783
749
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
784
- if (data.errors !== undefined && data.errors !== null) {
750
+ if (data.errors != null) {
785
751
  contents.errors = deserializeAws_restJson1BatchErrors(data.errors, context);
786
752
  }
787
- if (data.streamKeys !== undefined && data.streamKeys !== null) {
753
+ if (data.streamKeys != null) {
788
754
  contents.streamKeys = deserializeAws_restJson1StreamKeys(data.streamKeys, context);
789
755
  }
790
- return [2, Promise.resolve(contents)];
756
+ return [2, contents];
791
757
  }
792
758
  });
793
759
  }); };
794
760
  var deserializeAws_restJson1BatchGetStreamKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
795
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
761
+ var parsedOutput, _a, errorCode, parsedBody;
796
762
  var _b;
797
763
  return __generator(this, function (_c) {
798
764
  switch (_c.label) {
@@ -803,18 +769,13 @@ var deserializeAws_restJson1BatchGetStreamKeyCommandError = function (output, co
803
769
  case 1:
804
770
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
805
771
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
806
- switch (errorCode) {
807
- default:
808
- parsedBody = parsedOutput.body;
809
- $metadata = deserializeMetadata(output);
810
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
811
- response = new __BaseException({
812
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
813
- $fault: "client",
814
- $metadata: $metadata,
815
- });
816
- throw __decorateServiceException(response, parsedBody);
817
- }
772
+ parsedBody = parsedOutput.body;
773
+ throwDefaultError({
774
+ output: output,
775
+ parsedBody: parsedBody,
776
+ exceptionCtor: __BaseException,
777
+ errorCode: errorCode,
778
+ });
818
779
  return [2];
819
780
  }
820
781
  });
@@ -827,28 +788,26 @@ export var deserializeAws_restJson1CreateChannelCommand = function (output, cont
827
788
  if (output.statusCode !== 200 && output.statusCode >= 300) {
828
789
  return [2, deserializeAws_restJson1CreateChannelCommandError(output, context)];
829
790
  }
830
- contents = {
791
+ contents = map({
831
792
  $metadata: deserializeMetadata(output),
832
- channel: undefined,
833
- streamKey: undefined,
834
- };
793
+ });
835
794
  _a = __expectNonNull;
836
795
  _b = __expectObject;
837
796
  return [4, parseBody(output.body, context)];
838
797
  case 1:
839
798
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
840
- if (data.channel !== undefined && data.channel !== null) {
799
+ if (data.channel != null) {
841
800
  contents.channel = deserializeAws_restJson1Channel(data.channel, context);
842
801
  }
843
- if (data.streamKey !== undefined && data.streamKey !== null) {
802
+ if (data.streamKey != null) {
844
803
  contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
845
804
  }
846
- return [2, Promise.resolve(contents)];
805
+ return [2, contents];
847
806
  }
848
807
  });
849
808
  }); };
850
809
  var deserializeAws_restJson1CreateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
851
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
810
+ var parsedOutput, _a, errorCode, _b, parsedBody;
852
811
  var _c;
853
812
  return __generator(this, function (_d) {
854
813
  switch (_d.label) {
@@ -885,14 +844,14 @@ var deserializeAws_restJson1CreateChannelCommandError = function (output, contex
885
844
  case 11: throw _d.sent();
886
845
  case 12:
887
846
  parsedBody = parsedOutput.body;
888
- $metadata = deserializeMetadata(output);
889
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
890
- response = new __BaseException({
891
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
892
- $fault: "client",
893
- $metadata: $metadata,
847
+ throwDefaultError({
848
+ output: output,
849
+ parsedBody: parsedBody,
850
+ exceptionCtor: __BaseException,
851
+ errorCode: errorCode,
894
852
  });
895
- throw __decorateServiceException(response, parsedBody);
853
+ _d.label = 13;
854
+ case 13: return [2];
896
855
  }
897
856
  });
898
857
  }); };
@@ -904,24 +863,23 @@ export var deserializeAws_restJson1CreateRecordingConfigurationCommand = functio
904
863
  if (output.statusCode !== 200 && output.statusCode >= 300) {
905
864
  return [2, deserializeAws_restJson1CreateRecordingConfigurationCommandError(output, context)];
906
865
  }
907
- contents = {
866
+ contents = map({
908
867
  $metadata: deserializeMetadata(output),
909
- recordingConfiguration: undefined,
910
- };
868
+ });
911
869
  _a = __expectNonNull;
912
870
  _b = __expectObject;
913
871
  return [4, parseBody(output.body, context)];
914
872
  case 1:
915
873
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
916
- if (data.recordingConfiguration !== undefined && data.recordingConfiguration !== null) {
874
+ if (data.recordingConfiguration != null) {
917
875
  contents.recordingConfiguration = deserializeAws_restJson1RecordingConfiguration(data.recordingConfiguration, context);
918
876
  }
919
- return [2, Promise.resolve(contents)];
877
+ return [2, contents];
920
878
  }
921
879
  });
922
880
  }); };
923
881
  var deserializeAws_restJson1CreateRecordingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
924
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
882
+ var parsedOutput, _a, errorCode, _b, parsedBody;
925
883
  var _c;
926
884
  return __generator(this, function (_d) {
927
885
  switch (_d.label) {
@@ -962,14 +920,14 @@ var deserializeAws_restJson1CreateRecordingConfigurationCommandError = function
962
920
  case 13: throw _d.sent();
963
921
  case 14:
964
922
  parsedBody = parsedOutput.body;
965
- $metadata = deserializeMetadata(output);
966
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
967
- response = new __BaseException({
968
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
969
- $fault: "client",
970
- $metadata: $metadata,
923
+ throwDefaultError({
924
+ output: output,
925
+ parsedBody: parsedBody,
926
+ exceptionCtor: __BaseException,
927
+ errorCode: errorCode,
971
928
  });
972
- throw __decorateServiceException(response, parsedBody);
929
+ _d.label = 15;
930
+ case 15: return [2];
973
931
  }
974
932
  });
975
933
  }); };
@@ -981,24 +939,23 @@ export var deserializeAws_restJson1CreateStreamKeyCommand = function (output, co
981
939
  if (output.statusCode !== 200 && output.statusCode >= 300) {
982
940
  return [2, deserializeAws_restJson1CreateStreamKeyCommandError(output, context)];
983
941
  }
984
- contents = {
942
+ contents = map({
985
943
  $metadata: deserializeMetadata(output),
986
- streamKey: undefined,
987
- };
944
+ });
988
945
  _a = __expectNonNull;
989
946
  _b = __expectObject;
990
947
  return [4, parseBody(output.body, context)];
991
948
  case 1:
992
949
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
993
- if (data.streamKey !== undefined && data.streamKey !== null) {
950
+ if (data.streamKey != null) {
994
951
  contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
995
952
  }
996
- return [2, Promise.resolve(contents)];
953
+ return [2, contents];
997
954
  }
998
955
  });
999
956
  }); };
1000
957
  var deserializeAws_restJson1CreateStreamKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1001
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
958
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1002
959
  var _c;
1003
960
  return __generator(this, function (_d) {
1004
961
  switch (_d.label) {
@@ -1035,14 +992,14 @@ var deserializeAws_restJson1CreateStreamKeyCommandError = function (output, cont
1035
992
  case 11: throw _d.sent();
1036
993
  case 12:
1037
994
  parsedBody = parsedOutput.body;
1038
- $metadata = deserializeMetadata(output);
1039
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1040
- response = new __BaseException({
1041
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1042
- $fault: "client",
1043
- $metadata: $metadata,
995
+ throwDefaultError({
996
+ output: output,
997
+ parsedBody: parsedBody,
998
+ exceptionCtor: __BaseException,
999
+ errorCode: errorCode,
1044
1000
  });
1045
- throw __decorateServiceException(response, parsedBody);
1001
+ _d.label = 13;
1002
+ case 13: return [2];
1046
1003
  }
1047
1004
  });
1048
1005
  }); };
@@ -1054,18 +1011,18 @@ export var deserializeAws_restJson1DeleteChannelCommand = function (output, cont
1054
1011
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1055
1012
  return [2, deserializeAws_restJson1DeleteChannelCommandError(output, context)];
1056
1013
  }
1057
- contents = {
1014
+ contents = map({
1058
1015
  $metadata: deserializeMetadata(output),
1059
- };
1016
+ });
1060
1017
  return [4, collectBody(output.body, context)];
1061
1018
  case 1:
1062
1019
  _a.sent();
1063
- return [2, Promise.resolve(contents)];
1020
+ return [2, contents];
1064
1021
  }
1065
1022
  });
1066
1023
  }); };
1067
1024
  var deserializeAws_restJson1DeleteChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1068
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1025
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1069
1026
  var _c;
1070
1027
  return __generator(this, function (_d) {
1071
1028
  switch (_d.label) {
@@ -1102,14 +1059,14 @@ var deserializeAws_restJson1DeleteChannelCommandError = function (output, contex
1102
1059
  case 11: throw _d.sent();
1103
1060
  case 12:
1104
1061
  parsedBody = parsedOutput.body;
1105
- $metadata = deserializeMetadata(output);
1106
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1107
- response = new __BaseException({
1108
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1109
- $fault: "client",
1110
- $metadata: $metadata,
1062
+ throwDefaultError({
1063
+ output: output,
1064
+ parsedBody: parsedBody,
1065
+ exceptionCtor: __BaseException,
1066
+ errorCode: errorCode,
1111
1067
  });
1112
- throw __decorateServiceException(response, parsedBody);
1068
+ _d.label = 13;
1069
+ case 13: return [2];
1113
1070
  }
1114
1071
  });
1115
1072
  }); };
@@ -1121,18 +1078,18 @@ export var deserializeAws_restJson1DeletePlaybackKeyPairCommand = function (outp
1121
1078
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1122
1079
  return [2, deserializeAws_restJson1DeletePlaybackKeyPairCommandError(output, context)];
1123
1080
  }
1124
- contents = {
1081
+ contents = map({
1125
1082
  $metadata: deserializeMetadata(output),
1126
- };
1083
+ });
1127
1084
  return [4, collectBody(output.body, context)];
1128
1085
  case 1:
1129
1086
  _a.sent();
1130
- return [2, Promise.resolve(contents)];
1087
+ return [2, contents];
1131
1088
  }
1132
1089
  });
1133
1090
  }); };
1134
1091
  var deserializeAws_restJson1DeletePlaybackKeyPairCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1135
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1092
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1136
1093
  var _c;
1137
1094
  return __generator(this, function (_d) {
1138
1095
  switch (_d.label) {
@@ -1165,14 +1122,14 @@ var deserializeAws_restJson1DeletePlaybackKeyPairCommandError = function (output
1165
1122
  case 9: throw _d.sent();
1166
1123
  case 10:
1167
1124
  parsedBody = parsedOutput.body;
1168
- $metadata = deserializeMetadata(output);
1169
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1170
- response = new __BaseException({
1171
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1172
- $fault: "client",
1173
- $metadata: $metadata,
1125
+ throwDefaultError({
1126
+ output: output,
1127
+ parsedBody: parsedBody,
1128
+ exceptionCtor: __BaseException,
1129
+ errorCode: errorCode,
1174
1130
  });
1175
- throw __decorateServiceException(response, parsedBody);
1131
+ _d.label = 11;
1132
+ case 11: return [2];
1176
1133
  }
1177
1134
  });
1178
1135
  }); };
@@ -1184,18 +1141,18 @@ export var deserializeAws_restJson1DeleteRecordingConfigurationCommand = functio
1184
1141
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1185
1142
  return [2, deserializeAws_restJson1DeleteRecordingConfigurationCommandError(output, context)];
1186
1143
  }
1187
- contents = {
1144
+ contents = map({
1188
1145
  $metadata: deserializeMetadata(output),
1189
- };
1146
+ });
1190
1147
  return [4, collectBody(output.body, context)];
1191
1148
  case 1:
1192
1149
  _a.sent();
1193
- return [2, Promise.resolve(contents)];
1150
+ return [2, contents];
1194
1151
  }
1195
1152
  });
1196
1153
  }); };
1197
1154
  var deserializeAws_restJson1DeleteRecordingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1198
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1155
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1199
1156
  var _c;
1200
1157
  return __generator(this, function (_d) {
1201
1158
  switch (_d.label) {
@@ -1232,14 +1189,14 @@ var deserializeAws_restJson1DeleteRecordingConfigurationCommandError = function
1232
1189
  case 11: throw _d.sent();
1233
1190
  case 12:
1234
1191
  parsedBody = parsedOutput.body;
1235
- $metadata = deserializeMetadata(output);
1236
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1237
- response = new __BaseException({
1238
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1239
- $fault: "client",
1240
- $metadata: $metadata,
1192
+ throwDefaultError({
1193
+ output: output,
1194
+ parsedBody: parsedBody,
1195
+ exceptionCtor: __BaseException,
1196
+ errorCode: errorCode,
1241
1197
  });
1242
- throw __decorateServiceException(response, parsedBody);
1198
+ _d.label = 13;
1199
+ case 13: return [2];
1243
1200
  }
1244
1201
  });
1245
1202
  }); };
@@ -1251,18 +1208,18 @@ export var deserializeAws_restJson1DeleteStreamKeyCommand = function (output, co
1251
1208
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1252
1209
  return [2, deserializeAws_restJson1DeleteStreamKeyCommandError(output, context)];
1253
1210
  }
1254
- contents = {
1211
+ contents = map({
1255
1212
  $metadata: deserializeMetadata(output),
1256
- };
1213
+ });
1257
1214
  return [4, collectBody(output.body, context)];
1258
1215
  case 1:
1259
1216
  _a.sent();
1260
- return [2, Promise.resolve(contents)];
1217
+ return [2, contents];
1261
1218
  }
1262
1219
  });
1263
1220
  }); };
1264
1221
  var deserializeAws_restJson1DeleteStreamKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1265
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1222
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1266
1223
  var _c;
1267
1224
  return __generator(this, function (_d) {
1268
1225
  switch (_d.label) {
@@ -1295,14 +1252,14 @@ var deserializeAws_restJson1DeleteStreamKeyCommandError = function (output, cont
1295
1252
  case 9: throw _d.sent();
1296
1253
  case 10:
1297
1254
  parsedBody = parsedOutput.body;
1298
- $metadata = deserializeMetadata(output);
1299
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1300
- response = new __BaseException({
1301
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1302
- $fault: "client",
1303
- $metadata: $metadata,
1255
+ throwDefaultError({
1256
+ output: output,
1257
+ parsedBody: parsedBody,
1258
+ exceptionCtor: __BaseException,
1259
+ errorCode: errorCode,
1304
1260
  });
1305
- throw __decorateServiceException(response, parsedBody);
1261
+ _d.label = 11;
1262
+ case 11: return [2];
1306
1263
  }
1307
1264
  });
1308
1265
  }); };
@@ -1314,24 +1271,23 @@ export var deserializeAws_restJson1GetChannelCommand = function (output, context
1314
1271
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1315
1272
  return [2, deserializeAws_restJson1GetChannelCommandError(output, context)];
1316
1273
  }
1317
- contents = {
1274
+ contents = map({
1318
1275
  $metadata: deserializeMetadata(output),
1319
- channel: undefined,
1320
- };
1276
+ });
1321
1277
  _a = __expectNonNull;
1322
1278
  _b = __expectObject;
1323
1279
  return [4, parseBody(output.body, context)];
1324
1280
  case 1:
1325
1281
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1326
- if (data.channel !== undefined && data.channel !== null) {
1282
+ if (data.channel != null) {
1327
1283
  contents.channel = deserializeAws_restJson1Channel(data.channel, context);
1328
1284
  }
1329
- return [2, Promise.resolve(contents)];
1285
+ return [2, contents];
1330
1286
  }
1331
1287
  });
1332
1288
  }); };
1333
1289
  var deserializeAws_restJson1GetChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1334
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1290
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1335
1291
  var _c;
1336
1292
  return __generator(this, function (_d) {
1337
1293
  switch (_d.label) {
@@ -1360,14 +1316,14 @@ var deserializeAws_restJson1GetChannelCommandError = function (output, context)
1360
1316
  case 7: throw _d.sent();
1361
1317
  case 8:
1362
1318
  parsedBody = parsedOutput.body;
1363
- $metadata = deserializeMetadata(output);
1364
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1365
- response = new __BaseException({
1366
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1367
- $fault: "client",
1368
- $metadata: $metadata,
1319
+ throwDefaultError({
1320
+ output: output,
1321
+ parsedBody: parsedBody,
1322
+ exceptionCtor: __BaseException,
1323
+ errorCode: errorCode,
1369
1324
  });
1370
- throw __decorateServiceException(response, parsedBody);
1325
+ _d.label = 9;
1326
+ case 9: return [2];
1371
1327
  }
1372
1328
  });
1373
1329
  }); };
@@ -1379,24 +1335,23 @@ export var deserializeAws_restJson1GetPlaybackKeyPairCommand = function (output,
1379
1335
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1380
1336
  return [2, deserializeAws_restJson1GetPlaybackKeyPairCommandError(output, context)];
1381
1337
  }
1382
- contents = {
1338
+ contents = map({
1383
1339
  $metadata: deserializeMetadata(output),
1384
- keyPair: undefined,
1385
- };
1340
+ });
1386
1341
  _a = __expectNonNull;
1387
1342
  _b = __expectObject;
1388
1343
  return [4, parseBody(output.body, context)];
1389
1344
  case 1:
1390
1345
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1391
- if (data.keyPair !== undefined && data.keyPair !== null) {
1346
+ if (data.keyPair != null) {
1392
1347
  contents.keyPair = deserializeAws_restJson1PlaybackKeyPair(data.keyPair, context);
1393
1348
  }
1394
- return [2, Promise.resolve(contents)];
1349
+ return [2, contents];
1395
1350
  }
1396
1351
  });
1397
1352
  }); };
1398
1353
  var deserializeAws_restJson1GetPlaybackKeyPairCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1399
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1354
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1400
1355
  var _c;
1401
1356
  return __generator(this, function (_d) {
1402
1357
  switch (_d.label) {
@@ -1425,14 +1380,14 @@ var deserializeAws_restJson1GetPlaybackKeyPairCommandError = function (output, c
1425
1380
  case 7: throw _d.sent();
1426
1381
  case 8:
1427
1382
  parsedBody = parsedOutput.body;
1428
- $metadata = deserializeMetadata(output);
1429
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1430
- response = new __BaseException({
1431
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1432
- $fault: "client",
1433
- $metadata: $metadata,
1383
+ throwDefaultError({
1384
+ output: output,
1385
+ parsedBody: parsedBody,
1386
+ exceptionCtor: __BaseException,
1387
+ errorCode: errorCode,
1434
1388
  });
1435
- throw __decorateServiceException(response, parsedBody);
1389
+ _d.label = 9;
1390
+ case 9: return [2];
1436
1391
  }
1437
1392
  });
1438
1393
  }); };
@@ -1444,24 +1399,23 @@ export var deserializeAws_restJson1GetRecordingConfigurationCommand = function (
1444
1399
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1445
1400
  return [2, deserializeAws_restJson1GetRecordingConfigurationCommandError(output, context)];
1446
1401
  }
1447
- contents = {
1402
+ contents = map({
1448
1403
  $metadata: deserializeMetadata(output),
1449
- recordingConfiguration: undefined,
1450
- };
1404
+ });
1451
1405
  _a = __expectNonNull;
1452
1406
  _b = __expectObject;
1453
1407
  return [4, parseBody(output.body, context)];
1454
1408
  case 1:
1455
1409
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1456
- if (data.recordingConfiguration !== undefined && data.recordingConfiguration !== null) {
1410
+ if (data.recordingConfiguration != null) {
1457
1411
  contents.recordingConfiguration = deserializeAws_restJson1RecordingConfiguration(data.recordingConfiguration, context);
1458
1412
  }
1459
- return [2, Promise.resolve(contents)];
1413
+ return [2, contents];
1460
1414
  }
1461
1415
  });
1462
1416
  }); };
1463
1417
  var deserializeAws_restJson1GetRecordingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1464
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1418
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1465
1419
  var _c;
1466
1420
  return __generator(this, function (_d) {
1467
1421
  switch (_d.label) {
@@ -1494,14 +1448,14 @@ var deserializeAws_restJson1GetRecordingConfigurationCommandError = function (ou
1494
1448
  case 9: throw _d.sent();
1495
1449
  case 10:
1496
1450
  parsedBody = parsedOutput.body;
1497
- $metadata = deserializeMetadata(output);
1498
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1499
- response = new __BaseException({
1500
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1501
- $fault: "client",
1502
- $metadata: $metadata,
1451
+ throwDefaultError({
1452
+ output: output,
1453
+ parsedBody: parsedBody,
1454
+ exceptionCtor: __BaseException,
1455
+ errorCode: errorCode,
1503
1456
  });
1504
- throw __decorateServiceException(response, parsedBody);
1457
+ _d.label = 11;
1458
+ case 11: return [2];
1505
1459
  }
1506
1460
  });
1507
1461
  }); };
@@ -1513,24 +1467,23 @@ export var deserializeAws_restJson1GetStreamCommand = function (output, context)
1513
1467
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1514
1468
  return [2, deserializeAws_restJson1GetStreamCommandError(output, context)];
1515
1469
  }
1516
- contents = {
1470
+ contents = map({
1517
1471
  $metadata: deserializeMetadata(output),
1518
- stream: undefined,
1519
- };
1472
+ });
1520
1473
  _a = __expectNonNull;
1521
1474
  _b = __expectObject;
1522
1475
  return [4, parseBody(output.body, context)];
1523
1476
  case 1:
1524
1477
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1525
- if (data.stream !== undefined && data.stream !== null) {
1478
+ if (data.stream != null) {
1526
1479
  contents.stream = deserializeAws_restJson1_Stream(data.stream, context);
1527
1480
  }
1528
- return [2, Promise.resolve(contents)];
1481
+ return [2, contents];
1529
1482
  }
1530
1483
  });
1531
1484
  }); };
1532
1485
  var deserializeAws_restJson1GetStreamCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1533
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1486
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1534
1487
  var _c;
1535
1488
  return __generator(this, function (_d) {
1536
1489
  switch (_d.label) {
@@ -1563,14 +1516,14 @@ var deserializeAws_restJson1GetStreamCommandError = function (output, context) {
1563
1516
  case 9: throw _d.sent();
1564
1517
  case 10:
1565
1518
  parsedBody = parsedOutput.body;
1566
- $metadata = deserializeMetadata(output);
1567
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1568
- response = new __BaseException({
1569
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1570
- $fault: "client",
1571
- $metadata: $metadata,
1519
+ throwDefaultError({
1520
+ output: output,
1521
+ parsedBody: parsedBody,
1522
+ exceptionCtor: __BaseException,
1523
+ errorCode: errorCode,
1572
1524
  });
1573
- throw __decorateServiceException(response, parsedBody);
1525
+ _d.label = 11;
1526
+ case 11: return [2];
1574
1527
  }
1575
1528
  });
1576
1529
  }); };
@@ -1582,24 +1535,23 @@ export var deserializeAws_restJson1GetStreamKeyCommand = function (output, conte
1582
1535
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1583
1536
  return [2, deserializeAws_restJson1GetStreamKeyCommandError(output, context)];
1584
1537
  }
1585
- contents = {
1538
+ contents = map({
1586
1539
  $metadata: deserializeMetadata(output),
1587
- streamKey: undefined,
1588
- };
1540
+ });
1589
1541
  _a = __expectNonNull;
1590
1542
  _b = __expectObject;
1591
1543
  return [4, parseBody(output.body, context)];
1592
1544
  case 1:
1593
1545
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1594
- if (data.streamKey !== undefined && data.streamKey !== null) {
1546
+ if (data.streamKey != null) {
1595
1547
  contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
1596
1548
  }
1597
- return [2, Promise.resolve(contents)];
1549
+ return [2, contents];
1598
1550
  }
1599
1551
  });
1600
1552
  }); };
1601
1553
  var deserializeAws_restJson1GetStreamKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1602
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1554
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1603
1555
  var _c;
1604
1556
  return __generator(this, function (_d) {
1605
1557
  switch (_d.label) {
@@ -1628,14 +1580,14 @@ var deserializeAws_restJson1GetStreamKeyCommandError = function (output, context
1628
1580
  case 7: throw _d.sent();
1629
1581
  case 8:
1630
1582
  parsedBody = parsedOutput.body;
1631
- $metadata = deserializeMetadata(output);
1632
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1633
- response = new __BaseException({
1634
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1635
- $fault: "client",
1636
- $metadata: $metadata,
1583
+ throwDefaultError({
1584
+ output: output,
1585
+ parsedBody: parsedBody,
1586
+ exceptionCtor: __BaseException,
1587
+ errorCode: errorCode,
1637
1588
  });
1638
- throw __decorateServiceException(response, parsedBody);
1589
+ _d.label = 9;
1590
+ case 9: return [2];
1639
1591
  }
1640
1592
  });
1641
1593
  }); };
@@ -1647,24 +1599,23 @@ export var deserializeAws_restJson1GetStreamSessionCommand = function (output, c
1647
1599
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1648
1600
  return [2, deserializeAws_restJson1GetStreamSessionCommandError(output, context)];
1649
1601
  }
1650
- contents = {
1602
+ contents = map({
1651
1603
  $metadata: deserializeMetadata(output),
1652
- streamSession: undefined,
1653
- };
1604
+ });
1654
1605
  _a = __expectNonNull;
1655
1606
  _b = __expectObject;
1656
1607
  return [4, parseBody(output.body, context)];
1657
1608
  case 1:
1658
1609
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1659
- if (data.streamSession !== undefined && data.streamSession !== null) {
1610
+ if (data.streamSession != null) {
1660
1611
  contents.streamSession = deserializeAws_restJson1StreamSession(data.streamSession, context);
1661
1612
  }
1662
- return [2, Promise.resolve(contents)];
1613
+ return [2, contents];
1663
1614
  }
1664
1615
  });
1665
1616
  }); };
1666
1617
  var deserializeAws_restJson1GetStreamSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1667
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1618
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1668
1619
  var _c;
1669
1620
  return __generator(this, function (_d) {
1670
1621
  switch (_d.label) {
@@ -1693,14 +1644,14 @@ var deserializeAws_restJson1GetStreamSessionCommandError = function (output, con
1693
1644
  case 7: throw _d.sent();
1694
1645
  case 8:
1695
1646
  parsedBody = parsedOutput.body;
1696
- $metadata = deserializeMetadata(output);
1697
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1698
- response = new __BaseException({
1699
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1700
- $fault: "client",
1701
- $metadata: $metadata,
1647
+ throwDefaultError({
1648
+ output: output,
1649
+ parsedBody: parsedBody,
1650
+ exceptionCtor: __BaseException,
1651
+ errorCode: errorCode,
1702
1652
  });
1703
- throw __decorateServiceException(response, parsedBody);
1653
+ _d.label = 9;
1654
+ case 9: return [2];
1704
1655
  }
1705
1656
  });
1706
1657
  }); };
@@ -1712,24 +1663,23 @@ export var deserializeAws_restJson1ImportPlaybackKeyPairCommand = function (outp
1712
1663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1713
1664
  return [2, deserializeAws_restJson1ImportPlaybackKeyPairCommandError(output, context)];
1714
1665
  }
1715
- contents = {
1666
+ contents = map({
1716
1667
  $metadata: deserializeMetadata(output),
1717
- keyPair: undefined,
1718
- };
1668
+ });
1719
1669
  _a = __expectNonNull;
1720
1670
  _b = __expectObject;
1721
1671
  return [4, parseBody(output.body, context)];
1722
1672
  case 1:
1723
1673
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1724
- if (data.keyPair !== undefined && data.keyPair !== null) {
1674
+ if (data.keyPair != null) {
1725
1675
  contents.keyPair = deserializeAws_restJson1PlaybackKeyPair(data.keyPair, context);
1726
1676
  }
1727
- return [2, Promise.resolve(contents)];
1677
+ return [2, contents];
1728
1678
  }
1729
1679
  });
1730
1680
  }); };
1731
1681
  var deserializeAws_restJson1ImportPlaybackKeyPairCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1732
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1682
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1733
1683
  var _c;
1734
1684
  return __generator(this, function (_d) {
1735
1685
  switch (_d.label) {
@@ -1766,14 +1716,14 @@ var deserializeAws_restJson1ImportPlaybackKeyPairCommandError = function (output
1766
1716
  case 11: throw _d.sent();
1767
1717
  case 12:
1768
1718
  parsedBody = parsedOutput.body;
1769
- $metadata = deserializeMetadata(output);
1770
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1771
- response = new __BaseException({
1772
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1773
- $fault: "client",
1774
- $metadata: $metadata,
1719
+ throwDefaultError({
1720
+ output: output,
1721
+ parsedBody: parsedBody,
1722
+ exceptionCtor: __BaseException,
1723
+ errorCode: errorCode,
1775
1724
  });
1776
- throw __decorateServiceException(response, parsedBody);
1725
+ _d.label = 13;
1726
+ case 13: return [2];
1777
1727
  }
1778
1728
  });
1779
1729
  }); };
@@ -1785,28 +1735,26 @@ export var deserializeAws_restJson1ListChannelsCommand = function (output, conte
1785
1735
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1786
1736
  return [2, deserializeAws_restJson1ListChannelsCommandError(output, context)];
1787
1737
  }
1788
- contents = {
1738
+ contents = map({
1789
1739
  $metadata: deserializeMetadata(output),
1790
- channels: undefined,
1791
- nextToken: undefined,
1792
- };
1740
+ });
1793
1741
  _a = __expectNonNull;
1794
1742
  _b = __expectObject;
1795
1743
  return [4, parseBody(output.body, context)];
1796
1744
  case 1:
1797
1745
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1798
- if (data.channels !== undefined && data.channels !== null) {
1746
+ if (data.channels != null) {
1799
1747
  contents.channels = deserializeAws_restJson1ChannelList(data.channels, context);
1800
1748
  }
1801
- if (data.nextToken !== undefined && data.nextToken !== null) {
1749
+ if (data.nextToken != null) {
1802
1750
  contents.nextToken = __expectString(data.nextToken);
1803
1751
  }
1804
- return [2, Promise.resolve(contents)];
1752
+ return [2, contents];
1805
1753
  }
1806
1754
  });
1807
1755
  }); };
1808
1756
  var deserializeAws_restJson1ListChannelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1809
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1757
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1810
1758
  var _c;
1811
1759
  return __generator(this, function (_d) {
1812
1760
  switch (_d.label) {
@@ -1835,14 +1783,14 @@ var deserializeAws_restJson1ListChannelsCommandError = function (output, context
1835
1783
  case 7: throw _d.sent();
1836
1784
  case 8:
1837
1785
  parsedBody = parsedOutput.body;
1838
- $metadata = deserializeMetadata(output);
1839
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1840
- response = new __BaseException({
1841
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1842
- $fault: "client",
1843
- $metadata: $metadata,
1786
+ throwDefaultError({
1787
+ output: output,
1788
+ parsedBody: parsedBody,
1789
+ exceptionCtor: __BaseException,
1790
+ errorCode: errorCode,
1844
1791
  });
1845
- throw __decorateServiceException(response, parsedBody);
1792
+ _d.label = 9;
1793
+ case 9: return [2];
1846
1794
  }
1847
1795
  });
1848
1796
  }); };
@@ -1854,28 +1802,26 @@ export var deserializeAws_restJson1ListPlaybackKeyPairsCommand = function (outpu
1854
1802
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1855
1803
  return [2, deserializeAws_restJson1ListPlaybackKeyPairsCommandError(output, context)];
1856
1804
  }
1857
- contents = {
1805
+ contents = map({
1858
1806
  $metadata: deserializeMetadata(output),
1859
- keyPairs: undefined,
1860
- nextToken: undefined,
1861
- };
1807
+ });
1862
1808
  _a = __expectNonNull;
1863
1809
  _b = __expectObject;
1864
1810
  return [4, parseBody(output.body, context)];
1865
1811
  case 1:
1866
1812
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1867
- if (data.keyPairs !== undefined && data.keyPairs !== null) {
1813
+ if (data.keyPairs != null) {
1868
1814
  contents.keyPairs = deserializeAws_restJson1PlaybackKeyPairList(data.keyPairs, context);
1869
1815
  }
1870
- if (data.nextToken !== undefined && data.nextToken !== null) {
1816
+ if (data.nextToken != null) {
1871
1817
  contents.nextToken = __expectString(data.nextToken);
1872
1818
  }
1873
- return [2, Promise.resolve(contents)];
1819
+ return [2, contents];
1874
1820
  }
1875
1821
  });
1876
1822
  }); };
1877
1823
  var deserializeAws_restJson1ListPlaybackKeyPairsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1878
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1824
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1879
1825
  var _c;
1880
1826
  return __generator(this, function (_d) {
1881
1827
  switch (_d.label) {
@@ -1900,14 +1846,14 @@ var deserializeAws_restJson1ListPlaybackKeyPairsCommandError = function (output,
1900
1846
  case 5: throw _d.sent();
1901
1847
  case 6:
1902
1848
  parsedBody = parsedOutput.body;
1903
- $metadata = deserializeMetadata(output);
1904
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1905
- response = new __BaseException({
1906
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1907
- $fault: "client",
1908
- $metadata: $metadata,
1849
+ throwDefaultError({
1850
+ output: output,
1851
+ parsedBody: parsedBody,
1852
+ exceptionCtor: __BaseException,
1853
+ errorCode: errorCode,
1909
1854
  });
1910
- throw __decorateServiceException(response, parsedBody);
1855
+ _d.label = 7;
1856
+ case 7: return [2];
1911
1857
  }
1912
1858
  });
1913
1859
  }); };
@@ -1919,28 +1865,26 @@ export var deserializeAws_restJson1ListRecordingConfigurationsCommand = function
1919
1865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1920
1866
  return [2, deserializeAws_restJson1ListRecordingConfigurationsCommandError(output, context)];
1921
1867
  }
1922
- contents = {
1868
+ contents = map({
1923
1869
  $metadata: deserializeMetadata(output),
1924
- nextToken: undefined,
1925
- recordingConfigurations: undefined,
1926
- };
1870
+ });
1927
1871
  _a = __expectNonNull;
1928
1872
  _b = __expectObject;
1929
1873
  return [4, parseBody(output.body, context)];
1930
1874
  case 1:
1931
1875
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1932
- if (data.nextToken !== undefined && data.nextToken !== null) {
1876
+ if (data.nextToken != null) {
1933
1877
  contents.nextToken = __expectString(data.nextToken);
1934
1878
  }
1935
- if (data.recordingConfigurations !== undefined && data.recordingConfigurations !== null) {
1879
+ if (data.recordingConfigurations != null) {
1936
1880
  contents.recordingConfigurations = deserializeAws_restJson1RecordingConfigurationList(data.recordingConfigurations, context);
1937
1881
  }
1938
- return [2, Promise.resolve(contents)];
1882
+ return [2, contents];
1939
1883
  }
1940
1884
  });
1941
1885
  }); };
1942
1886
  var deserializeAws_restJson1ListRecordingConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1943
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1887
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1944
1888
  var _c;
1945
1889
  return __generator(this, function (_d) {
1946
1890
  switch (_d.label) {
@@ -1969,14 +1913,14 @@ var deserializeAws_restJson1ListRecordingConfigurationsCommandError = function (
1969
1913
  case 7: throw _d.sent();
1970
1914
  case 8:
1971
1915
  parsedBody = parsedOutput.body;
1972
- $metadata = deserializeMetadata(output);
1973
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1974
- response = new __BaseException({
1975
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1976
- $fault: "client",
1977
- $metadata: $metadata,
1916
+ throwDefaultError({
1917
+ output: output,
1918
+ parsedBody: parsedBody,
1919
+ exceptionCtor: __BaseException,
1920
+ errorCode: errorCode,
1978
1921
  });
1979
- throw __decorateServiceException(response, parsedBody);
1922
+ _d.label = 9;
1923
+ case 9: return [2];
1980
1924
  }
1981
1925
  });
1982
1926
  }); };
@@ -1988,28 +1932,26 @@ export var deserializeAws_restJson1ListStreamKeysCommand = function (output, con
1988
1932
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1989
1933
  return [2, deserializeAws_restJson1ListStreamKeysCommandError(output, context)];
1990
1934
  }
1991
- contents = {
1935
+ contents = map({
1992
1936
  $metadata: deserializeMetadata(output),
1993
- nextToken: undefined,
1994
- streamKeys: undefined,
1995
- };
1937
+ });
1996
1938
  _a = __expectNonNull;
1997
1939
  _b = __expectObject;
1998
1940
  return [4, parseBody(output.body, context)];
1999
1941
  case 1:
2000
1942
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2001
- if (data.nextToken !== undefined && data.nextToken !== null) {
1943
+ if (data.nextToken != null) {
2002
1944
  contents.nextToken = __expectString(data.nextToken);
2003
1945
  }
2004
- if (data.streamKeys !== undefined && data.streamKeys !== null) {
1946
+ if (data.streamKeys != null) {
2005
1947
  contents.streamKeys = deserializeAws_restJson1StreamKeyList(data.streamKeys, context);
2006
1948
  }
2007
- return [2, Promise.resolve(contents)];
1949
+ return [2, contents];
2008
1950
  }
2009
1951
  });
2010
1952
  }); };
2011
1953
  var deserializeAws_restJson1ListStreamKeysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2012
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1954
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2013
1955
  var _c;
2014
1956
  return __generator(this, function (_d) {
2015
1957
  switch (_d.label) {
@@ -2038,14 +1980,14 @@ var deserializeAws_restJson1ListStreamKeysCommandError = function (output, conte
2038
1980
  case 7: throw _d.sent();
2039
1981
  case 8:
2040
1982
  parsedBody = parsedOutput.body;
2041
- $metadata = deserializeMetadata(output);
2042
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2043
- response = new __BaseException({
2044
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2045
- $fault: "client",
2046
- $metadata: $metadata,
1983
+ throwDefaultError({
1984
+ output: output,
1985
+ parsedBody: parsedBody,
1986
+ exceptionCtor: __BaseException,
1987
+ errorCode: errorCode,
2047
1988
  });
2048
- throw __decorateServiceException(response, parsedBody);
1989
+ _d.label = 9;
1990
+ case 9: return [2];
2049
1991
  }
2050
1992
  });
2051
1993
  }); };
@@ -2057,28 +1999,26 @@ export var deserializeAws_restJson1ListStreamsCommand = function (output, contex
2057
1999
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2058
2000
  return [2, deserializeAws_restJson1ListStreamsCommandError(output, context)];
2059
2001
  }
2060
- contents = {
2002
+ contents = map({
2061
2003
  $metadata: deserializeMetadata(output),
2062
- nextToken: undefined,
2063
- streams: undefined,
2064
- };
2004
+ });
2065
2005
  _a = __expectNonNull;
2066
2006
  _b = __expectObject;
2067
2007
  return [4, parseBody(output.body, context)];
2068
2008
  case 1:
2069
2009
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2070
- if (data.nextToken !== undefined && data.nextToken !== null) {
2010
+ if (data.nextToken != null) {
2071
2011
  contents.nextToken = __expectString(data.nextToken);
2072
2012
  }
2073
- if (data.streams !== undefined && data.streams !== null) {
2013
+ if (data.streams != null) {
2074
2014
  contents.streams = deserializeAws_restJson1StreamList(data.streams, context);
2075
2015
  }
2076
- return [2, Promise.resolve(contents)];
2016
+ return [2, contents];
2077
2017
  }
2078
2018
  });
2079
2019
  }); };
2080
2020
  var deserializeAws_restJson1ListStreamsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2081
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2021
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2082
2022
  var _c;
2083
2023
  return __generator(this, function (_d) {
2084
2024
  switch (_d.label) {
@@ -2103,14 +2043,14 @@ var deserializeAws_restJson1ListStreamsCommandError = function (output, context)
2103
2043
  case 5: throw _d.sent();
2104
2044
  case 6:
2105
2045
  parsedBody = parsedOutput.body;
2106
- $metadata = deserializeMetadata(output);
2107
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2108
- response = new __BaseException({
2109
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2110
- $fault: "client",
2111
- $metadata: $metadata,
2046
+ throwDefaultError({
2047
+ output: output,
2048
+ parsedBody: parsedBody,
2049
+ exceptionCtor: __BaseException,
2050
+ errorCode: errorCode,
2112
2051
  });
2113
- throw __decorateServiceException(response, parsedBody);
2052
+ _d.label = 7;
2053
+ case 7: return [2];
2114
2054
  }
2115
2055
  });
2116
2056
  }); };
@@ -2122,28 +2062,26 @@ export var deserializeAws_restJson1ListStreamSessionsCommand = function (output,
2122
2062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2123
2063
  return [2, deserializeAws_restJson1ListStreamSessionsCommandError(output, context)];
2124
2064
  }
2125
- contents = {
2065
+ contents = map({
2126
2066
  $metadata: deserializeMetadata(output),
2127
- nextToken: undefined,
2128
- streamSessions: undefined,
2129
- };
2067
+ });
2130
2068
  _a = __expectNonNull;
2131
2069
  _b = __expectObject;
2132
2070
  return [4, parseBody(output.body, context)];
2133
2071
  case 1:
2134
2072
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2135
- if (data.nextToken !== undefined && data.nextToken !== null) {
2073
+ if (data.nextToken != null) {
2136
2074
  contents.nextToken = __expectString(data.nextToken);
2137
2075
  }
2138
- if (data.streamSessions !== undefined && data.streamSessions !== null) {
2076
+ if (data.streamSessions != null) {
2139
2077
  contents.streamSessions = deserializeAws_restJson1StreamSessionList(data.streamSessions, context);
2140
2078
  }
2141
- return [2, Promise.resolve(contents)];
2079
+ return [2, contents];
2142
2080
  }
2143
2081
  });
2144
2082
  }); };
2145
2083
  var deserializeAws_restJson1ListStreamSessionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2146
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2084
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2147
2085
  var _c;
2148
2086
  return __generator(this, function (_d) {
2149
2087
  switch (_d.label) {
@@ -2172,14 +2110,14 @@ var deserializeAws_restJson1ListStreamSessionsCommandError = function (output, c
2172
2110
  case 7: throw _d.sent();
2173
2111
  case 8:
2174
2112
  parsedBody = parsedOutput.body;
2175
- $metadata = deserializeMetadata(output);
2176
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2177
- response = new __BaseException({
2178
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2179
- $fault: "client",
2180
- $metadata: $metadata,
2113
+ throwDefaultError({
2114
+ output: output,
2115
+ parsedBody: parsedBody,
2116
+ exceptionCtor: __BaseException,
2117
+ errorCode: errorCode,
2181
2118
  });
2182
- throw __decorateServiceException(response, parsedBody);
2119
+ _d.label = 9;
2120
+ case 9: return [2];
2183
2121
  }
2184
2122
  });
2185
2123
  }); };
@@ -2191,24 +2129,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2191
2129
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2192
2130
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2193
2131
  }
2194
- contents = {
2132
+ contents = map({
2195
2133
  $metadata: deserializeMetadata(output),
2196
- tags: undefined,
2197
- };
2134
+ });
2198
2135
  _a = __expectNonNull;
2199
2136
  _b = __expectObject;
2200
2137
  return [4, parseBody(output.body, context)];
2201
2138
  case 1:
2202
2139
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2203
- if (data.tags !== undefined && data.tags !== null) {
2140
+ if (data.tags != null) {
2204
2141
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
2205
2142
  }
2206
- return [2, Promise.resolve(contents)];
2143
+ return [2, contents];
2207
2144
  }
2208
2145
  });
2209
2146
  }); };
2210
2147
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2211
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2148
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2212
2149
  var _c;
2213
2150
  return __generator(this, function (_d) {
2214
2151
  switch (_d.label) {
@@ -2237,14 +2174,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2237
2174
  case 7: throw _d.sent();
2238
2175
  case 8:
2239
2176
  parsedBody = parsedOutput.body;
2240
- $metadata = deserializeMetadata(output);
2241
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2242
- response = new __BaseException({
2243
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2244
- $fault: "client",
2245
- $metadata: $metadata,
2177
+ throwDefaultError({
2178
+ output: output,
2179
+ parsedBody: parsedBody,
2180
+ exceptionCtor: __BaseException,
2181
+ errorCode: errorCode,
2246
2182
  });
2247
- throw __decorateServiceException(response, parsedBody);
2183
+ _d.label = 9;
2184
+ case 9: return [2];
2248
2185
  }
2249
2186
  });
2250
2187
  }); };
@@ -2256,18 +2193,18 @@ export var deserializeAws_restJson1PutMetadataCommand = function (output, contex
2256
2193
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2257
2194
  return [2, deserializeAws_restJson1PutMetadataCommandError(output, context)];
2258
2195
  }
2259
- contents = {
2196
+ contents = map({
2260
2197
  $metadata: deserializeMetadata(output),
2261
- };
2198
+ });
2262
2199
  return [4, collectBody(output.body, context)];
2263
2200
  case 1:
2264
2201
  _a.sent();
2265
- return [2, Promise.resolve(contents)];
2202
+ return [2, contents];
2266
2203
  }
2267
2204
  });
2268
2205
  }); };
2269
2206
  var deserializeAws_restJson1PutMetadataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2270
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2207
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2271
2208
  var _c;
2272
2209
  return __generator(this, function (_d) {
2273
2210
  switch (_d.label) {
@@ -2304,14 +2241,14 @@ var deserializeAws_restJson1PutMetadataCommandError = function (output, context)
2304
2241
  case 11: throw _d.sent();
2305
2242
  case 12:
2306
2243
  parsedBody = parsedOutput.body;
2307
- $metadata = deserializeMetadata(output);
2308
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2309
- response = new __BaseException({
2310
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2311
- $fault: "client",
2312
- $metadata: $metadata,
2244
+ throwDefaultError({
2245
+ output: output,
2246
+ parsedBody: parsedBody,
2247
+ exceptionCtor: __BaseException,
2248
+ errorCode: errorCode,
2313
2249
  });
2314
- throw __decorateServiceException(response, parsedBody);
2250
+ _d.label = 13;
2251
+ case 13: return [2];
2315
2252
  }
2316
2253
  });
2317
2254
  }); };
@@ -2323,18 +2260,18 @@ export var deserializeAws_restJson1StopStreamCommand = function (output, context
2323
2260
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2324
2261
  return [2, deserializeAws_restJson1StopStreamCommandError(output, context)];
2325
2262
  }
2326
- contents = {
2263
+ contents = map({
2327
2264
  $metadata: deserializeMetadata(output),
2328
- };
2265
+ });
2329
2266
  return [4, collectBody(output.body, context)];
2330
2267
  case 1:
2331
2268
  _a.sent();
2332
- return [2, Promise.resolve(contents)];
2269
+ return [2, contents];
2333
2270
  }
2334
2271
  });
2335
2272
  }); };
2336
2273
  var deserializeAws_restJson1StopStreamCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2337
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2274
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2338
2275
  var _c;
2339
2276
  return __generator(this, function (_d) {
2340
2277
  switch (_d.label) {
@@ -2371,14 +2308,14 @@ var deserializeAws_restJson1StopStreamCommandError = function (output, context)
2371
2308
  case 11: throw _d.sent();
2372
2309
  case 12:
2373
2310
  parsedBody = parsedOutput.body;
2374
- $metadata = deserializeMetadata(output);
2375
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2376
- response = new __BaseException({
2377
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2378
- $fault: "client",
2379
- $metadata: $metadata,
2311
+ throwDefaultError({
2312
+ output: output,
2313
+ parsedBody: parsedBody,
2314
+ exceptionCtor: __BaseException,
2315
+ errorCode: errorCode,
2380
2316
  });
2381
- throw __decorateServiceException(response, parsedBody);
2317
+ _d.label = 13;
2318
+ case 13: return [2];
2382
2319
  }
2383
2320
  });
2384
2321
  }); };
@@ -2390,18 +2327,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2390
2327
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2391
2328
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2392
2329
  }
2393
- contents = {
2330
+ contents = map({
2394
2331
  $metadata: deserializeMetadata(output),
2395
- };
2332
+ });
2396
2333
  return [4, collectBody(output.body, context)];
2397
2334
  case 1:
2398
2335
  _a.sent();
2399
- return [2, Promise.resolve(contents)];
2336
+ return [2, contents];
2400
2337
  }
2401
2338
  });
2402
2339
  }); };
2403
2340
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2404
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2341
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2405
2342
  var _c;
2406
2343
  return __generator(this, function (_d) {
2407
2344
  switch (_d.label) {
@@ -2430,14 +2367,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2430
2367
  case 7: throw _d.sent();
2431
2368
  case 8:
2432
2369
  parsedBody = parsedOutput.body;
2433
- $metadata = deserializeMetadata(output);
2434
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2435
- response = new __BaseException({
2436
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2437
- $fault: "client",
2438
- $metadata: $metadata,
2370
+ throwDefaultError({
2371
+ output: output,
2372
+ parsedBody: parsedBody,
2373
+ exceptionCtor: __BaseException,
2374
+ errorCode: errorCode,
2439
2375
  });
2440
- throw __decorateServiceException(response, parsedBody);
2376
+ _d.label = 9;
2377
+ case 9: return [2];
2441
2378
  }
2442
2379
  });
2443
2380
  }); };
@@ -2449,18 +2386,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2449
2386
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2450
2387
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2451
2388
  }
2452
- contents = {
2389
+ contents = map({
2453
2390
  $metadata: deserializeMetadata(output),
2454
- };
2391
+ });
2455
2392
  return [4, collectBody(output.body, context)];
2456
2393
  case 1:
2457
2394
  _a.sent();
2458
- return [2, Promise.resolve(contents)];
2395
+ return [2, contents];
2459
2396
  }
2460
2397
  });
2461
2398
  }); };
2462
2399
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2463
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2400
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2464
2401
  var _c;
2465
2402
  return __generator(this, function (_d) {
2466
2403
  switch (_d.label) {
@@ -2489,14 +2426,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2489
2426
  case 7: throw _d.sent();
2490
2427
  case 8:
2491
2428
  parsedBody = parsedOutput.body;
2492
- $metadata = deserializeMetadata(output);
2493
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2494
- response = new __BaseException({
2495
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2496
- $fault: "client",
2497
- $metadata: $metadata,
2429
+ throwDefaultError({
2430
+ output: output,
2431
+ parsedBody: parsedBody,
2432
+ exceptionCtor: __BaseException,
2433
+ errorCode: errorCode,
2498
2434
  });
2499
- throw __decorateServiceException(response, parsedBody);
2435
+ _d.label = 9;
2436
+ case 9: return [2];
2500
2437
  }
2501
2438
  });
2502
2439
  }); };
@@ -2508,24 +2445,23 @@ export var deserializeAws_restJson1UpdateChannelCommand = function (output, cont
2508
2445
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2509
2446
  return [2, deserializeAws_restJson1UpdateChannelCommandError(output, context)];
2510
2447
  }
2511
- contents = {
2448
+ contents = map({
2512
2449
  $metadata: deserializeMetadata(output),
2513
- channel: undefined,
2514
- };
2450
+ });
2515
2451
  _a = __expectNonNull;
2516
2452
  _b = __expectObject;
2517
2453
  return [4, parseBody(output.body, context)];
2518
2454
  case 1:
2519
2455
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2520
- if (data.channel !== undefined && data.channel !== null) {
2456
+ if (data.channel != null) {
2521
2457
  contents.channel = deserializeAws_restJson1Channel(data.channel, context);
2522
2458
  }
2523
- return [2, Promise.resolve(contents)];
2459
+ return [2, contents];
2524
2460
  }
2525
2461
  });
2526
2462
  }); };
2527
2463
  var deserializeAws_restJson1UpdateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2528
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2464
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2529
2465
  var _c;
2530
2466
  return __generator(this, function (_d) {
2531
2467
  switch (_d.label) {
@@ -2562,23 +2498,24 @@ var deserializeAws_restJson1UpdateChannelCommandError = function (output, contex
2562
2498
  case 11: throw _d.sent();
2563
2499
  case 12:
2564
2500
  parsedBody = parsedOutput.body;
2565
- $metadata = deserializeMetadata(output);
2566
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2567
- response = new __BaseException({
2568
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2569
- $fault: "client",
2570
- $metadata: $metadata,
2501
+ throwDefaultError({
2502
+ output: output,
2503
+ parsedBody: parsedBody,
2504
+ exceptionCtor: __BaseException,
2505
+ errorCode: errorCode,
2571
2506
  });
2572
- throw __decorateServiceException(response, parsedBody);
2507
+ _d.label = 13;
2508
+ case 13: return [2];
2573
2509
  }
2574
2510
  });
2575
2511
  }); };
2512
+ var map = __map;
2576
2513
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2577
2514
  var contents, data, exception;
2578
2515
  return __generator(this, function (_a) {
2579
- contents = {};
2516
+ contents = map({});
2580
2517
  data = parsedOutput.body;
2581
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2518
+ if (data.exceptionMessage != null) {
2582
2519
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2583
2520
  }
2584
2521
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2588,9 +2525,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
2588
2525
  var deserializeAws_restJson1ChannelNotBroadcastingResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2589
2526
  var contents, data, exception;
2590
2527
  return __generator(this, function (_a) {
2591
- contents = {};
2528
+ contents = map({});
2592
2529
  data = parsedOutput.body;
2593
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2530
+ if (data.exceptionMessage != null) {
2594
2531
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2595
2532
  }
2596
2533
  exception = new ChannelNotBroadcasting(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2600,9 +2537,9 @@ var deserializeAws_restJson1ChannelNotBroadcastingResponse = function (parsedOut
2600
2537
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2601
2538
  var contents, data, exception;
2602
2539
  return __generator(this, function (_a) {
2603
- contents = {};
2540
+ contents = map({});
2604
2541
  data = parsedOutput.body;
2605
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2542
+ if (data.exceptionMessage != null) {
2606
2543
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2607
2544
  }
2608
2545
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2612,9 +2549,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
2612
2549
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2613
2550
  var contents, data, exception;
2614
2551
  return __generator(this, function (_a) {
2615
- contents = {};
2552
+ contents = map({});
2616
2553
  data = parsedOutput.body;
2617
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2554
+ if (data.exceptionMessage != null) {
2618
2555
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2619
2556
  }
2620
2557
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2624,9 +2561,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
2624
2561
  var deserializeAws_restJson1PendingVerificationResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2625
2562
  var contents, data, exception;
2626
2563
  return __generator(this, function (_a) {
2627
- contents = {};
2564
+ contents = map({});
2628
2565
  data = parsedOutput.body;
2629
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2566
+ if (data.exceptionMessage != null) {
2630
2567
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2631
2568
  }
2632
2569
  exception = new PendingVerification(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2636,9 +2573,9 @@ var deserializeAws_restJson1PendingVerificationResponse = function (parsedOutput
2636
2573
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2637
2574
  var contents, data, exception;
2638
2575
  return __generator(this, function (_a) {
2639
- contents = {};
2576
+ contents = map({});
2640
2577
  data = parsedOutput.body;
2641
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2578
+ if (data.exceptionMessage != null) {
2642
2579
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2643
2580
  }
2644
2581
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2648,9 +2585,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
2648
2585
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2649
2586
  var contents, data, exception;
2650
2587
  return __generator(this, function (_a) {
2651
- contents = {};
2588
+ contents = map({});
2652
2589
  data = parsedOutput.body;
2653
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2590
+ if (data.exceptionMessage != null) {
2654
2591
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2655
2592
  }
2656
2593
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2660,9 +2597,9 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
2660
2597
  var deserializeAws_restJson1StreamUnavailableResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2661
2598
  var contents, data, exception;
2662
2599
  return __generator(this, function (_a) {
2663
- contents = {};
2600
+ contents = map({});
2664
2601
  data = parsedOutput.body;
2665
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2602
+ if (data.exceptionMessage != null) {
2666
2603
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2667
2604
  }
2668
2605
  exception = new StreamUnavailable(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2672,9 +2609,9 @@ var deserializeAws_restJson1StreamUnavailableResponse = function (parsedOutput,
2672
2609
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2673
2610
  var contents, data, exception;
2674
2611
  return __generator(this, function (_a) {
2675
- contents = {};
2612
+ contents = map({});
2676
2613
  data = parsedOutput.body;
2677
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2614
+ if (data.exceptionMessage != null) {
2678
2615
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2679
2616
  }
2680
2617
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2684,9 +2621,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
2684
2621
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2685
2622
  var contents, data, exception;
2686
2623
  return __generator(this, function (_a) {
2687
- contents = {};
2624
+ contents = map({});
2688
2625
  data = parsedOutput.body;
2689
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2626
+ if (data.exceptionMessage != null) {
2690
2627
  contents.exceptionMessage = __expectString(data.exceptionMessage);
2691
2628
  }
2692
2629
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2697,9 +2634,6 @@ var serializeAws_restJson1ChannelArnList = function (input, context) {
2697
2634
  return input
2698
2635
  .filter(function (e) { return e != null; })
2699
2636
  .map(function (entry) {
2700
- if (entry === null) {
2701
- return null;
2702
- }
2703
2637
  return entry;
2704
2638
  });
2705
2639
  };
@@ -2716,9 +2650,6 @@ var serializeAws_restJson1StreamKeyArnList = function (input, context) {
2716
2650
  return input
2717
2651
  .filter(function (e) { return e != null; })
2718
2652
  .map(function (entry) {
2719
- if (entry === null) {
2720
- return null;
2721
- }
2722
2653
  return entry;
2723
2654
  });
2724
2655
  };