@aws-sdk/client-mq 3.52.0 → 3.54.1

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.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1UpdateUserCommand = exports.deserializeAws_restJ
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const models_0_1 = require("../models/models_0");
8
+ const MqServiceException_1 = require("../models/MqServiceException");
7
9
  const serializeAws_restJson1CreateBrokerCommand = async (input, context) => {
8
10
  var _a;
9
11
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -750,59 +752,28 @@ const deserializeAws_restJson1CreateBrokerCommandError = async (output, context)
750
752
  switch (errorCode) {
751
753
  case "BadRequestException":
752
754
  case "com.amazonaws.mq#BadRequestException":
753
- response = {
754
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
755
- name: errorCode,
756
- $metadata: deserializeMetadata(output),
757
- };
758
- break;
755
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
759
756
  case "ConflictException":
760
757
  case "com.amazonaws.mq#ConflictException":
761
- response = {
762
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
763
- name: errorCode,
764
- $metadata: deserializeMetadata(output),
765
- };
766
- break;
758
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
767
759
  case "ForbiddenException":
768
760
  case "com.amazonaws.mq#ForbiddenException":
769
- response = {
770
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
771
- name: errorCode,
772
- $metadata: deserializeMetadata(output),
773
- };
774
- break;
761
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
775
762
  case "InternalServerErrorException":
776
763
  case "com.amazonaws.mq#InternalServerErrorException":
777
- response = {
778
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
779
- name: errorCode,
780
- $metadata: deserializeMetadata(output),
781
- };
782
- break;
764
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
783
765
  case "UnauthorizedException":
784
766
  case "com.amazonaws.mq#UnauthorizedException":
785
- response = {
786
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
787
- name: errorCode,
788
- $metadata: deserializeMetadata(output),
789
- };
790
- break;
767
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
791
768
  default:
792
769
  const parsedBody = parsedOutput.body;
793
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
794
- response = {
795
- ...parsedBody,
796
- name: `${errorCode}`,
797
- message: parsedBody.message || parsedBody.Message || errorCode,
770
+ response = new MqServiceException_1.MqServiceException({
771
+ name: parsedBody.code || parsedBody.Code || errorCode,
798
772
  $fault: "client",
799
773
  $metadata: deserializeMetadata(output),
800
- };
774
+ });
775
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
801
776
  }
802
- const message = response.message || response.Message || errorCode;
803
- response.message = message;
804
- delete response.Message;
805
- return Promise.reject(Object.assign(new Error(message), response));
806
777
  };
807
778
  const deserializeAws_restJson1CreateConfigurationCommand = async (output, context) => {
808
779
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -850,51 +821,25 @@ const deserializeAws_restJson1CreateConfigurationCommandError = async (output, c
850
821
  switch (errorCode) {
851
822
  case "BadRequestException":
852
823
  case "com.amazonaws.mq#BadRequestException":
853
- response = {
854
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
855
- name: errorCode,
856
- $metadata: deserializeMetadata(output),
857
- };
858
- break;
824
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
859
825
  case "ConflictException":
860
826
  case "com.amazonaws.mq#ConflictException":
861
- response = {
862
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
863
- name: errorCode,
864
- $metadata: deserializeMetadata(output),
865
- };
866
- break;
827
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
867
828
  case "ForbiddenException":
868
829
  case "com.amazonaws.mq#ForbiddenException":
869
- response = {
870
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
871
- name: errorCode,
872
- $metadata: deserializeMetadata(output),
873
- };
874
- break;
830
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
875
831
  case "InternalServerErrorException":
876
832
  case "com.amazonaws.mq#InternalServerErrorException":
877
- response = {
878
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
879
- name: errorCode,
880
- $metadata: deserializeMetadata(output),
881
- };
882
- break;
833
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
883
834
  default:
884
835
  const parsedBody = parsedOutput.body;
885
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
886
- response = {
887
- ...parsedBody,
888
- name: `${errorCode}`,
889
- message: parsedBody.message || parsedBody.Message || errorCode,
836
+ response = new MqServiceException_1.MqServiceException({
837
+ name: parsedBody.code || parsedBody.Code || errorCode,
890
838
  $fault: "client",
891
839
  $metadata: deserializeMetadata(output),
892
- };
840
+ });
841
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
893
842
  }
894
- const message = response.message || response.Message || errorCode;
895
- response.message = message;
896
- delete response.Message;
897
- return Promise.reject(Object.assign(new Error(message), response));
898
843
  };
899
844
  const deserializeAws_restJson1CreateTagsCommand = async (output, context) => {
900
845
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -918,51 +863,25 @@ const deserializeAws_restJson1CreateTagsCommandError = async (output, context) =
918
863
  switch (errorCode) {
919
864
  case "BadRequestException":
920
865
  case "com.amazonaws.mq#BadRequestException":
921
- response = {
922
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
923
- name: errorCode,
924
- $metadata: deserializeMetadata(output),
925
- };
926
- break;
866
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
927
867
  case "ForbiddenException":
928
868
  case "com.amazonaws.mq#ForbiddenException":
929
- response = {
930
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
931
- name: errorCode,
932
- $metadata: deserializeMetadata(output),
933
- };
934
- break;
869
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
935
870
  case "InternalServerErrorException":
936
871
  case "com.amazonaws.mq#InternalServerErrorException":
937
- response = {
938
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
939
- name: errorCode,
940
- $metadata: deserializeMetadata(output),
941
- };
942
- break;
872
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
943
873
  case "NotFoundException":
944
874
  case "com.amazonaws.mq#NotFoundException":
945
- response = {
946
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
947
- name: errorCode,
948
- $metadata: deserializeMetadata(output),
949
- };
950
- break;
875
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
951
876
  default:
952
877
  const parsedBody = parsedOutput.body;
953
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
954
- response = {
955
- ...parsedBody,
956
- name: `${errorCode}`,
957
- message: parsedBody.message || parsedBody.Message || errorCode,
878
+ response = new MqServiceException_1.MqServiceException({
879
+ name: parsedBody.code || parsedBody.Code || errorCode,
958
880
  $fault: "client",
959
881
  $metadata: deserializeMetadata(output),
960
- };
882
+ });
883
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
961
884
  }
962
- const message = response.message || response.Message || errorCode;
963
- response.message = message;
964
- delete response.Message;
965
- return Promise.reject(Object.assign(new Error(message), response));
966
885
  };
967
886
  const deserializeAws_restJson1CreateUserCommand = async (output, context) => {
968
887
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -986,59 +905,28 @@ const deserializeAws_restJson1CreateUserCommandError = async (output, context) =
986
905
  switch (errorCode) {
987
906
  case "BadRequestException":
988
907
  case "com.amazonaws.mq#BadRequestException":
989
- response = {
990
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
991
- name: errorCode,
992
- $metadata: deserializeMetadata(output),
993
- };
994
- break;
908
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
995
909
  case "ConflictException":
996
910
  case "com.amazonaws.mq#ConflictException":
997
- response = {
998
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
999
- name: errorCode,
1000
- $metadata: deserializeMetadata(output),
1001
- };
1002
- break;
911
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1003
912
  case "ForbiddenException":
1004
913
  case "com.amazonaws.mq#ForbiddenException":
1005
- response = {
1006
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1007
- name: errorCode,
1008
- $metadata: deserializeMetadata(output),
1009
- };
1010
- break;
914
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1011
915
  case "InternalServerErrorException":
1012
916
  case "com.amazonaws.mq#InternalServerErrorException":
1013
- response = {
1014
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1015
- name: errorCode,
1016
- $metadata: deserializeMetadata(output),
1017
- };
1018
- break;
917
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1019
918
  case "NotFoundException":
1020
919
  case "com.amazonaws.mq#NotFoundException":
1021
- response = {
1022
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1023
- name: errorCode,
1024
- $metadata: deserializeMetadata(output),
1025
- };
1026
- break;
920
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1027
921
  default:
1028
922
  const parsedBody = parsedOutput.body;
1029
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1030
- response = {
1031
- ...parsedBody,
1032
- name: `${errorCode}`,
1033
- message: parsedBody.message || parsedBody.Message || errorCode,
923
+ response = new MqServiceException_1.MqServiceException({
924
+ name: parsedBody.code || parsedBody.Code || errorCode,
1034
925
  $fault: "client",
1035
926
  $metadata: deserializeMetadata(output),
1036
- };
927
+ });
928
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1037
929
  }
1038
- const message = response.message || response.Message || errorCode;
1039
- response.message = message;
1040
- delete response.Message;
1041
- return Promise.reject(Object.assign(new Error(message), response));
1042
930
  };
1043
931
  const deserializeAws_restJson1DeleteBrokerCommand = async (output, context) => {
1044
932
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1066,51 +954,25 @@ const deserializeAws_restJson1DeleteBrokerCommandError = async (output, context)
1066
954
  switch (errorCode) {
1067
955
  case "BadRequestException":
1068
956
  case "com.amazonaws.mq#BadRequestException":
1069
- response = {
1070
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1071
- name: errorCode,
1072
- $metadata: deserializeMetadata(output),
1073
- };
1074
- break;
957
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1075
958
  case "ForbiddenException":
1076
959
  case "com.amazonaws.mq#ForbiddenException":
1077
- response = {
1078
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1079
- name: errorCode,
1080
- $metadata: deserializeMetadata(output),
1081
- };
1082
- break;
960
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1083
961
  case "InternalServerErrorException":
1084
962
  case "com.amazonaws.mq#InternalServerErrorException":
1085
- response = {
1086
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1087
- name: errorCode,
1088
- $metadata: deserializeMetadata(output),
1089
- };
1090
- break;
963
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1091
964
  case "NotFoundException":
1092
965
  case "com.amazonaws.mq#NotFoundException":
1093
- response = {
1094
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1095
- name: errorCode,
1096
- $metadata: deserializeMetadata(output),
1097
- };
1098
- break;
966
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1099
967
  default:
1100
968
  const parsedBody = parsedOutput.body;
1101
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1102
- response = {
1103
- ...parsedBody,
1104
- name: `${errorCode}`,
1105
- message: parsedBody.message || parsedBody.Message || errorCode,
969
+ response = new MqServiceException_1.MqServiceException({
970
+ name: parsedBody.code || parsedBody.Code || errorCode,
1106
971
  $fault: "client",
1107
972
  $metadata: deserializeMetadata(output),
1108
- };
973
+ });
974
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1109
975
  }
1110
- const message = response.message || response.Message || errorCode;
1111
- response.message = message;
1112
- delete response.Message;
1113
- return Promise.reject(Object.assign(new Error(message), response));
1114
976
  };
1115
977
  const deserializeAws_restJson1DeleteTagsCommand = async (output, context) => {
1116
978
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1134,51 +996,25 @@ const deserializeAws_restJson1DeleteTagsCommandError = async (output, context) =
1134
996
  switch (errorCode) {
1135
997
  case "BadRequestException":
1136
998
  case "com.amazonaws.mq#BadRequestException":
1137
- response = {
1138
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1139
- name: errorCode,
1140
- $metadata: deserializeMetadata(output),
1141
- };
1142
- break;
999
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1143
1000
  case "ForbiddenException":
1144
1001
  case "com.amazonaws.mq#ForbiddenException":
1145
- response = {
1146
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1147
- name: errorCode,
1148
- $metadata: deserializeMetadata(output),
1149
- };
1150
- break;
1002
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1151
1003
  case "InternalServerErrorException":
1152
1004
  case "com.amazonaws.mq#InternalServerErrorException":
1153
- response = {
1154
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1155
- name: errorCode,
1156
- $metadata: deserializeMetadata(output),
1157
- };
1158
- break;
1005
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1159
1006
  case "NotFoundException":
1160
1007
  case "com.amazonaws.mq#NotFoundException":
1161
- response = {
1162
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1163
- name: errorCode,
1164
- $metadata: deserializeMetadata(output),
1165
- };
1166
- break;
1008
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1167
1009
  default:
1168
1010
  const parsedBody = parsedOutput.body;
1169
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1170
- response = {
1171
- ...parsedBody,
1172
- name: `${errorCode}`,
1173
- message: parsedBody.message || parsedBody.Message || errorCode,
1011
+ response = new MqServiceException_1.MqServiceException({
1012
+ name: parsedBody.code || parsedBody.Code || errorCode,
1174
1013
  $fault: "client",
1175
1014
  $metadata: deserializeMetadata(output),
1176
- };
1015
+ });
1016
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1177
1017
  }
1178
- const message = response.message || response.Message || errorCode;
1179
- response.message = message;
1180
- delete response.Message;
1181
- return Promise.reject(Object.assign(new Error(message), response));
1182
1018
  };
1183
1019
  const deserializeAws_restJson1DeleteUserCommand = async (output, context) => {
1184
1020
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1202,51 +1038,25 @@ const deserializeAws_restJson1DeleteUserCommandError = async (output, context) =
1202
1038
  switch (errorCode) {
1203
1039
  case "BadRequestException":
1204
1040
  case "com.amazonaws.mq#BadRequestException":
1205
- response = {
1206
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1207
- name: errorCode,
1208
- $metadata: deserializeMetadata(output),
1209
- };
1210
- break;
1041
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1211
1042
  case "ForbiddenException":
1212
1043
  case "com.amazonaws.mq#ForbiddenException":
1213
- response = {
1214
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1215
- name: errorCode,
1216
- $metadata: deserializeMetadata(output),
1217
- };
1218
- break;
1044
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1219
1045
  case "InternalServerErrorException":
1220
1046
  case "com.amazonaws.mq#InternalServerErrorException":
1221
- response = {
1222
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1223
- name: errorCode,
1224
- $metadata: deserializeMetadata(output),
1225
- };
1226
- break;
1047
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1227
1048
  case "NotFoundException":
1228
1049
  case "com.amazonaws.mq#NotFoundException":
1229
- response = {
1230
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1231
- name: errorCode,
1232
- $metadata: deserializeMetadata(output),
1233
- };
1234
- break;
1050
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1235
1051
  default:
1236
1052
  const parsedBody = parsedOutput.body;
1237
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1238
- response = {
1239
- ...parsedBody,
1240
- name: `${errorCode}`,
1241
- message: parsedBody.message || parsedBody.Message || errorCode,
1053
+ response = new MqServiceException_1.MqServiceException({
1054
+ name: parsedBody.code || parsedBody.Code || errorCode,
1242
1055
  $fault: "client",
1243
1056
  $metadata: deserializeMetadata(output),
1244
- };
1057
+ });
1058
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1245
1059
  }
1246
- const message = response.message || response.Message || errorCode;
1247
- response.message = message;
1248
- delete response.Message;
1249
- return Promise.reject(Object.assign(new Error(message), response));
1250
1060
  };
1251
1061
  const deserializeAws_restJson1DescribeBrokerCommand = async (output, context) => {
1252
1062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1382,51 +1192,25 @@ const deserializeAws_restJson1DescribeBrokerCommandError = async (output, contex
1382
1192
  switch (errorCode) {
1383
1193
  case "BadRequestException":
1384
1194
  case "com.amazonaws.mq#BadRequestException":
1385
- response = {
1386
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1387
- name: errorCode,
1388
- $metadata: deserializeMetadata(output),
1389
- };
1390
- break;
1195
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1391
1196
  case "ForbiddenException":
1392
1197
  case "com.amazonaws.mq#ForbiddenException":
1393
- response = {
1394
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
1198
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1399
1199
  case "InternalServerErrorException":
1400
1200
  case "com.amazonaws.mq#InternalServerErrorException":
1401
- response = {
1402
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
1201
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1407
1202
  case "NotFoundException":
1408
1203
  case "com.amazonaws.mq#NotFoundException":
1409
- response = {
1410
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1411
- name: errorCode,
1412
- $metadata: deserializeMetadata(output),
1413
- };
1414
- break;
1204
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1415
1205
  default:
1416
1206
  const parsedBody = parsedOutput.body;
1417
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1418
- response = {
1419
- ...parsedBody,
1420
- name: `${errorCode}`,
1421
- message: parsedBody.message || parsedBody.Message || errorCode,
1207
+ response = new MqServiceException_1.MqServiceException({
1208
+ name: parsedBody.code || parsedBody.Code || errorCode,
1422
1209
  $fault: "client",
1423
1210
  $metadata: deserializeMetadata(output),
1424
- };
1211
+ });
1212
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1425
1213
  }
1426
- const message = response.message || response.Message || errorCode;
1427
- response.message = message;
1428
- delete response.Message;
1429
- return Promise.reject(Object.assign(new Error(message), response));
1430
1214
  };
1431
1215
  const deserializeAws_restJson1DescribeBrokerEngineTypesCommand = async (output, context) => {
1432
1216
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1462,43 +1246,22 @@ const deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = async (out
1462
1246
  switch (errorCode) {
1463
1247
  case "BadRequestException":
1464
1248
  case "com.amazonaws.mq#BadRequestException":
1465
- response = {
1466
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1467
- name: errorCode,
1468
- $metadata: deserializeMetadata(output),
1469
- };
1470
- break;
1249
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1471
1250
  case "ForbiddenException":
1472
1251
  case "com.amazonaws.mq#ForbiddenException":
1473
- response = {
1474
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1475
- name: errorCode,
1476
- $metadata: deserializeMetadata(output),
1477
- };
1478
- break;
1252
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1479
1253
  case "InternalServerErrorException":
1480
1254
  case "com.amazonaws.mq#InternalServerErrorException":
1481
- response = {
1482
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1483
- name: errorCode,
1484
- $metadata: deserializeMetadata(output),
1485
- };
1486
- break;
1255
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1487
1256
  default:
1488
1257
  const parsedBody = parsedOutput.body;
1489
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1490
- response = {
1491
- ...parsedBody,
1492
- name: `${errorCode}`,
1493
- message: parsedBody.message || parsedBody.Message || errorCode,
1258
+ response = new MqServiceException_1.MqServiceException({
1259
+ name: parsedBody.code || parsedBody.Code || errorCode,
1494
1260
  $fault: "client",
1495
1261
  $metadata: deserializeMetadata(output),
1496
- };
1262
+ });
1263
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1497
1264
  }
1498
- const message = response.message || response.Message || errorCode;
1499
- response.message = message;
1500
- delete response.Message;
1501
- return Promise.reject(Object.assign(new Error(message), response));
1502
1265
  };
1503
1266
  const deserializeAws_restJson1DescribeBrokerInstanceOptionsCommand = async (output, context) => {
1504
1267
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1534,43 +1297,22 @@ const deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = async
1534
1297
  switch (errorCode) {
1535
1298
  case "BadRequestException":
1536
1299
  case "com.amazonaws.mq#BadRequestException":
1537
- response = {
1538
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1539
- name: errorCode,
1540
- $metadata: deserializeMetadata(output),
1541
- };
1542
- break;
1300
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1543
1301
  case "ForbiddenException":
1544
1302
  case "com.amazonaws.mq#ForbiddenException":
1545
- response = {
1546
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1547
- name: errorCode,
1548
- $metadata: deserializeMetadata(output),
1549
- };
1550
- break;
1303
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1551
1304
  case "InternalServerErrorException":
1552
1305
  case "com.amazonaws.mq#InternalServerErrorException":
1553
- response = {
1554
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1555
- name: errorCode,
1556
- $metadata: deserializeMetadata(output),
1557
- };
1558
- break;
1306
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1559
1307
  default:
1560
1308
  const parsedBody = parsedOutput.body;
1561
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1562
- response = {
1563
- ...parsedBody,
1564
- name: `${errorCode}`,
1565
- message: parsedBody.message || parsedBody.Message || errorCode,
1309
+ response = new MqServiceException_1.MqServiceException({
1310
+ name: parsedBody.code || parsedBody.Code || errorCode,
1566
1311
  $fault: "client",
1567
1312
  $metadata: deserializeMetadata(output),
1568
- };
1313
+ });
1314
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1569
1315
  }
1570
- const message = response.message || response.Message || errorCode;
1571
- response.message = message;
1572
- delete response.Message;
1573
- return Promise.reject(Object.assign(new Error(message), response));
1574
1316
  };
1575
1317
  const deserializeAws_restJson1DescribeConfigurationCommand = async (output, context) => {
1576
1318
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1634,51 +1376,25 @@ const deserializeAws_restJson1DescribeConfigurationCommandError = async (output,
1634
1376
  switch (errorCode) {
1635
1377
  case "BadRequestException":
1636
1378
  case "com.amazonaws.mq#BadRequestException":
1637
- response = {
1638
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1639
- name: errorCode,
1640
- $metadata: deserializeMetadata(output),
1641
- };
1642
- break;
1379
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1643
1380
  case "ForbiddenException":
1644
1381
  case "com.amazonaws.mq#ForbiddenException":
1645
- response = {
1646
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1647
- name: errorCode,
1648
- $metadata: deserializeMetadata(output),
1649
- };
1650
- break;
1382
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1651
1383
  case "InternalServerErrorException":
1652
1384
  case "com.amazonaws.mq#InternalServerErrorException":
1653
- response = {
1654
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1655
- name: errorCode,
1656
- $metadata: deserializeMetadata(output),
1657
- };
1658
- break;
1385
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1659
1386
  case "NotFoundException":
1660
1387
  case "com.amazonaws.mq#NotFoundException":
1661
- response = {
1662
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1663
- name: errorCode,
1664
- $metadata: deserializeMetadata(output),
1665
- };
1666
- break;
1388
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1667
1389
  default:
1668
1390
  const parsedBody = parsedOutput.body;
1669
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1670
- response = {
1671
- ...parsedBody,
1672
- name: `${errorCode}`,
1673
- message: parsedBody.message || parsedBody.Message || errorCode,
1391
+ response = new MqServiceException_1.MqServiceException({
1392
+ name: parsedBody.code || parsedBody.Code || errorCode,
1674
1393
  $fault: "client",
1675
1394
  $metadata: deserializeMetadata(output),
1676
- };
1395
+ });
1396
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1677
1397
  }
1678
- const message = response.message || response.Message || errorCode;
1679
- response.message = message;
1680
- delete response.Message;
1681
- return Promise.reject(Object.assign(new Error(message), response));
1682
1398
  };
1683
1399
  const deserializeAws_restJson1DescribeConfigurationRevisionCommand = async (output, context) => {
1684
1400
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1718,51 +1434,25 @@ const deserializeAws_restJson1DescribeConfigurationRevisionCommandError = async
1718
1434
  switch (errorCode) {
1719
1435
  case "BadRequestException":
1720
1436
  case "com.amazonaws.mq#BadRequestException":
1721
- response = {
1722
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1723
- name: errorCode,
1724
- $metadata: deserializeMetadata(output),
1725
- };
1726
- break;
1437
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1727
1438
  case "ForbiddenException":
1728
1439
  case "com.amazonaws.mq#ForbiddenException":
1729
- response = {
1730
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1731
- name: errorCode,
1732
- $metadata: deserializeMetadata(output),
1733
- };
1734
- break;
1440
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1735
1441
  case "InternalServerErrorException":
1736
1442
  case "com.amazonaws.mq#InternalServerErrorException":
1737
- response = {
1738
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1739
- name: errorCode,
1740
- $metadata: deserializeMetadata(output),
1741
- };
1742
- break;
1443
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1743
1444
  case "NotFoundException":
1744
1445
  case "com.amazonaws.mq#NotFoundException":
1745
- response = {
1746
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1747
- name: errorCode,
1748
- $metadata: deserializeMetadata(output),
1749
- };
1750
- break;
1446
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1751
1447
  default:
1752
1448
  const parsedBody = parsedOutput.body;
1753
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1754
- response = {
1755
- ...parsedBody,
1756
- name: `${errorCode}`,
1757
- message: parsedBody.message || parsedBody.Message || errorCode,
1449
+ response = new MqServiceException_1.MqServiceException({
1450
+ name: parsedBody.code || parsedBody.Code || errorCode,
1758
1451
  $fault: "client",
1759
1452
  $metadata: deserializeMetadata(output),
1760
- };
1453
+ });
1454
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1761
1455
  }
1762
- const message = response.message || response.Message || errorCode;
1763
- response.message = message;
1764
- delete response.Message;
1765
- return Promise.reject(Object.assign(new Error(message), response));
1766
1456
  };
1767
1457
  const deserializeAws_restJson1DescribeUserCommand = async (output, context) => {
1768
1458
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1806,51 +1496,25 @@ const deserializeAws_restJson1DescribeUserCommandError = async (output, context)
1806
1496
  switch (errorCode) {
1807
1497
  case "BadRequestException":
1808
1498
  case "com.amazonaws.mq#BadRequestException":
1809
- response = {
1810
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1811
- name: errorCode,
1812
- $metadata: deserializeMetadata(output),
1813
- };
1814
- break;
1499
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1815
1500
  case "ForbiddenException":
1816
1501
  case "com.amazonaws.mq#ForbiddenException":
1817
- response = {
1818
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1819
- name: errorCode,
1820
- $metadata: deserializeMetadata(output),
1821
- };
1822
- break;
1502
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1823
1503
  case "InternalServerErrorException":
1824
1504
  case "com.amazonaws.mq#InternalServerErrorException":
1825
- response = {
1826
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1827
- name: errorCode,
1828
- $metadata: deserializeMetadata(output),
1829
- };
1830
- break;
1505
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1831
1506
  case "NotFoundException":
1832
1507
  case "com.amazonaws.mq#NotFoundException":
1833
- response = {
1834
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1835
- name: errorCode,
1836
- $metadata: deserializeMetadata(output),
1837
- };
1838
- break;
1508
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1839
1509
  default:
1840
1510
  const parsedBody = parsedOutput.body;
1841
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1842
- response = {
1843
- ...parsedBody,
1844
- name: `${errorCode}`,
1845
- message: parsedBody.message || parsedBody.Message || errorCode,
1511
+ response = new MqServiceException_1.MqServiceException({
1512
+ name: parsedBody.code || parsedBody.Code || errorCode,
1846
1513
  $fault: "client",
1847
1514
  $metadata: deserializeMetadata(output),
1848
- };
1515
+ });
1516
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1849
1517
  }
1850
- const message = response.message || response.Message || errorCode;
1851
- response.message = message;
1852
- delete response.Message;
1853
- return Promise.reject(Object.assign(new Error(message), response));
1854
1518
  };
1855
1519
  const deserializeAws_restJson1ListBrokersCommand = async (output, context) => {
1856
1520
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1882,43 +1546,22 @@ const deserializeAws_restJson1ListBrokersCommandError = async (output, context)
1882
1546
  switch (errorCode) {
1883
1547
  case "BadRequestException":
1884
1548
  case "com.amazonaws.mq#BadRequestException":
1885
- response = {
1886
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1887
- name: errorCode,
1888
- $metadata: deserializeMetadata(output),
1889
- };
1890
- break;
1549
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1891
1550
  case "ForbiddenException":
1892
1551
  case "com.amazonaws.mq#ForbiddenException":
1893
- response = {
1894
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1895
- name: errorCode,
1896
- $metadata: deserializeMetadata(output),
1897
- };
1898
- break;
1552
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1899
1553
  case "InternalServerErrorException":
1900
1554
  case "com.amazonaws.mq#InternalServerErrorException":
1901
- response = {
1902
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1903
- name: errorCode,
1904
- $metadata: deserializeMetadata(output),
1905
- };
1906
- break;
1555
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1907
1556
  default:
1908
1557
  const parsedBody = parsedOutput.body;
1909
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1910
- response = {
1911
- ...parsedBody,
1912
- name: `${errorCode}`,
1913
- message: parsedBody.message || parsedBody.Message || errorCode,
1558
+ response = new MqServiceException_1.MqServiceException({
1559
+ name: parsedBody.code || parsedBody.Code || errorCode,
1914
1560
  $fault: "client",
1915
1561
  $metadata: deserializeMetadata(output),
1916
- };
1562
+ });
1563
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1917
1564
  }
1918
- const message = response.message || response.Message || errorCode;
1919
- response.message = message;
1920
- delete response.Message;
1921
- return Promise.reject(Object.assign(new Error(message), response));
1922
1565
  };
1923
1566
  const deserializeAws_restJson1ListConfigurationRevisionsCommand = async (output, context) => {
1924
1567
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1958,51 +1601,25 @@ const deserializeAws_restJson1ListConfigurationRevisionsCommandError = async (ou
1958
1601
  switch (errorCode) {
1959
1602
  case "BadRequestException":
1960
1603
  case "com.amazonaws.mq#BadRequestException":
1961
- response = {
1962
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1963
- name: errorCode,
1964
- $metadata: deserializeMetadata(output),
1965
- };
1966
- break;
1604
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1967
1605
  case "ForbiddenException":
1968
1606
  case "com.amazonaws.mq#ForbiddenException":
1969
- response = {
1970
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1971
- name: errorCode,
1972
- $metadata: deserializeMetadata(output),
1973
- };
1974
- break;
1607
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1975
1608
  case "InternalServerErrorException":
1976
1609
  case "com.amazonaws.mq#InternalServerErrorException":
1977
- response = {
1978
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1979
- name: errorCode,
1980
- $metadata: deserializeMetadata(output),
1981
- };
1982
- break;
1610
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1983
1611
  case "NotFoundException":
1984
1612
  case "com.amazonaws.mq#NotFoundException":
1985
- response = {
1986
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1987
- name: errorCode,
1988
- $metadata: deserializeMetadata(output),
1989
- };
1990
- break;
1613
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1991
1614
  default:
1992
1615
  const parsedBody = parsedOutput.body;
1993
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1994
- response = {
1995
- ...parsedBody,
1996
- name: `${errorCode}`,
1997
- message: parsedBody.message || parsedBody.Message || errorCode,
1616
+ response = new MqServiceException_1.MqServiceException({
1617
+ name: parsedBody.code || parsedBody.Code || errorCode,
1998
1618
  $fault: "client",
1999
1619
  $metadata: deserializeMetadata(output),
2000
- };
1620
+ });
1621
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2001
1622
  }
2002
- const message = response.message || response.Message || errorCode;
2003
- response.message = message;
2004
- delete response.Message;
2005
- return Promise.reject(Object.assign(new Error(message), response));
2006
1623
  };
2007
1624
  const deserializeAws_restJson1ListConfigurationsCommand = async (output, context) => {
2008
1625
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2038,43 +1655,22 @@ const deserializeAws_restJson1ListConfigurationsCommandError = async (output, co
2038
1655
  switch (errorCode) {
2039
1656
  case "BadRequestException":
2040
1657
  case "com.amazonaws.mq#BadRequestException":
2041
- response = {
2042
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2043
- name: errorCode,
2044
- $metadata: deserializeMetadata(output),
2045
- };
2046
- break;
1658
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2047
1659
  case "ForbiddenException":
2048
1660
  case "com.amazonaws.mq#ForbiddenException":
2049
- response = {
2050
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2051
- name: errorCode,
2052
- $metadata: deserializeMetadata(output),
2053
- };
2054
- break;
1661
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2055
1662
  case "InternalServerErrorException":
2056
1663
  case "com.amazonaws.mq#InternalServerErrorException":
2057
- response = {
2058
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2059
- name: errorCode,
2060
- $metadata: deserializeMetadata(output),
2061
- };
2062
- break;
1664
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2063
1665
  default:
2064
1666
  const parsedBody = parsedOutput.body;
2065
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2066
- response = {
2067
- ...parsedBody,
2068
- name: `${errorCode}`,
2069
- message: parsedBody.message || parsedBody.Message || errorCode,
1667
+ response = new MqServiceException_1.MqServiceException({
1668
+ name: parsedBody.code || parsedBody.Code || errorCode,
2070
1669
  $fault: "client",
2071
1670
  $metadata: deserializeMetadata(output),
2072
- };
1671
+ });
1672
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2073
1673
  }
2074
- const message = response.message || response.Message || errorCode;
2075
- response.message = message;
2076
- delete response.Message;
2077
- return Promise.reject(Object.assign(new Error(message), response));
2078
1674
  };
2079
1675
  const deserializeAws_restJson1ListTagsCommand = async (output, context) => {
2080
1676
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2102,51 +1698,25 @@ const deserializeAws_restJson1ListTagsCommandError = async (output, context) =>
2102
1698
  switch (errorCode) {
2103
1699
  case "BadRequestException":
2104
1700
  case "com.amazonaws.mq#BadRequestException":
2105
- response = {
2106
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2107
- name: errorCode,
2108
- $metadata: deserializeMetadata(output),
2109
- };
2110
- break;
1701
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2111
1702
  case "ForbiddenException":
2112
1703
  case "com.amazonaws.mq#ForbiddenException":
2113
- response = {
2114
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2115
- name: errorCode,
2116
- $metadata: deserializeMetadata(output),
2117
- };
2118
- break;
1704
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2119
1705
  case "InternalServerErrorException":
2120
1706
  case "com.amazonaws.mq#InternalServerErrorException":
2121
- response = {
2122
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2123
- name: errorCode,
2124
- $metadata: deserializeMetadata(output),
2125
- };
2126
- break;
1707
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2127
1708
  case "NotFoundException":
2128
1709
  case "com.amazonaws.mq#NotFoundException":
2129
- response = {
2130
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2131
- name: errorCode,
2132
- $metadata: deserializeMetadata(output),
2133
- };
2134
- break;
1710
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2135
1711
  default:
2136
1712
  const parsedBody = parsedOutput.body;
2137
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2138
- response = {
2139
- ...parsedBody,
2140
- name: `${errorCode}`,
2141
- message: parsedBody.message || parsedBody.Message || errorCode,
1713
+ response = new MqServiceException_1.MqServiceException({
1714
+ name: parsedBody.code || parsedBody.Code || errorCode,
2142
1715
  $fault: "client",
2143
1716
  $metadata: deserializeMetadata(output),
2144
- };
1717
+ });
1718
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2145
1719
  }
2146
- const message = response.message || response.Message || errorCode;
2147
- response.message = message;
2148
- delete response.Message;
2149
- return Promise.reject(Object.assign(new Error(message), response));
2150
1720
  };
2151
1721
  const deserializeAws_restJson1ListUsersCommand = async (output, context) => {
2152
1722
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2186,51 +1756,25 @@ const deserializeAws_restJson1ListUsersCommandError = async (output, context) =>
2186
1756
  switch (errorCode) {
2187
1757
  case "BadRequestException":
2188
1758
  case "com.amazonaws.mq#BadRequestException":
2189
- response = {
2190
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2191
- name: errorCode,
2192
- $metadata: deserializeMetadata(output),
2193
- };
2194
- break;
1759
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2195
1760
  case "ForbiddenException":
2196
1761
  case "com.amazonaws.mq#ForbiddenException":
2197
- response = {
2198
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2199
- name: errorCode,
2200
- $metadata: deserializeMetadata(output),
2201
- };
2202
- break;
1762
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2203
1763
  case "InternalServerErrorException":
2204
1764
  case "com.amazonaws.mq#InternalServerErrorException":
2205
- response = {
2206
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2207
- name: errorCode,
2208
- $metadata: deserializeMetadata(output),
2209
- };
2210
- break;
1765
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2211
1766
  case "NotFoundException":
2212
1767
  case "com.amazonaws.mq#NotFoundException":
2213
- response = {
2214
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2215
- name: errorCode,
2216
- $metadata: deserializeMetadata(output),
2217
- };
2218
- break;
1768
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2219
1769
  default:
2220
1770
  const parsedBody = parsedOutput.body;
2221
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2222
- response = {
2223
- ...parsedBody,
2224
- name: `${errorCode}`,
2225
- message: parsedBody.message || parsedBody.Message || errorCode,
1771
+ response = new MqServiceException_1.MqServiceException({
1772
+ name: parsedBody.code || parsedBody.Code || errorCode,
2226
1773
  $fault: "client",
2227
1774
  $metadata: deserializeMetadata(output),
2228
- };
1775
+ });
1776
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2229
1777
  }
2230
- const message = response.message || response.Message || errorCode;
2231
- response.message = message;
2232
- delete response.Message;
2233
- return Promise.reject(Object.assign(new Error(message), response));
2234
1778
  };
2235
1779
  const deserializeAws_restJson1RebootBrokerCommand = async (output, context) => {
2236
1780
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2254,51 +1798,25 @@ const deserializeAws_restJson1RebootBrokerCommandError = async (output, context)
2254
1798
  switch (errorCode) {
2255
1799
  case "BadRequestException":
2256
1800
  case "com.amazonaws.mq#BadRequestException":
2257
- response = {
2258
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2259
- name: errorCode,
2260
- $metadata: deserializeMetadata(output),
2261
- };
2262
- break;
1801
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2263
1802
  case "ForbiddenException":
2264
1803
  case "com.amazonaws.mq#ForbiddenException":
2265
- response = {
2266
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2267
- name: errorCode,
2268
- $metadata: deserializeMetadata(output),
2269
- };
2270
- break;
1804
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2271
1805
  case "InternalServerErrorException":
2272
1806
  case "com.amazonaws.mq#InternalServerErrorException":
2273
- response = {
2274
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2275
- name: errorCode,
2276
- $metadata: deserializeMetadata(output),
2277
- };
2278
- break;
1807
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2279
1808
  case "NotFoundException":
2280
1809
  case "com.amazonaws.mq#NotFoundException":
2281
- response = {
2282
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2283
- name: errorCode,
2284
- $metadata: deserializeMetadata(output),
2285
- };
2286
- break;
1810
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2287
1811
  default:
2288
1812
  const parsedBody = parsedOutput.body;
2289
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2290
- response = {
2291
- ...parsedBody,
2292
- name: `${errorCode}`,
2293
- message: parsedBody.message || parsedBody.Message || errorCode,
1813
+ response = new MqServiceException_1.MqServiceException({
1814
+ name: parsedBody.code || parsedBody.Code || errorCode,
2294
1815
  $fault: "client",
2295
1816
  $metadata: deserializeMetadata(output),
2296
- };
1817
+ });
1818
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2297
1819
  }
2298
- const message = response.message || response.Message || errorCode;
2299
- response.message = message;
2300
- delete response.Message;
2301
- return Promise.reject(Object.assign(new Error(message), response));
2302
1820
  };
2303
1821
  const deserializeAws_restJson1UpdateBrokerCommand = async (output, context) => {
2304
1822
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2362,59 +1880,28 @@ const deserializeAws_restJson1UpdateBrokerCommandError = async (output, context)
2362
1880
  switch (errorCode) {
2363
1881
  case "BadRequestException":
2364
1882
  case "com.amazonaws.mq#BadRequestException":
2365
- response = {
2366
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2367
- name: errorCode,
2368
- $metadata: deserializeMetadata(output),
2369
- };
2370
- break;
1883
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2371
1884
  case "ConflictException":
2372
1885
  case "com.amazonaws.mq#ConflictException":
2373
- response = {
2374
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2375
- name: errorCode,
2376
- $metadata: deserializeMetadata(output),
2377
- };
2378
- break;
1886
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2379
1887
  case "ForbiddenException":
2380
1888
  case "com.amazonaws.mq#ForbiddenException":
2381
- response = {
2382
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2383
- name: errorCode,
2384
- $metadata: deserializeMetadata(output),
2385
- };
2386
- break;
1889
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2387
1890
  case "InternalServerErrorException":
2388
1891
  case "com.amazonaws.mq#InternalServerErrorException":
2389
- response = {
2390
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2391
- name: errorCode,
2392
- $metadata: deserializeMetadata(output),
2393
- };
2394
- break;
1892
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2395
1893
  case "NotFoundException":
2396
1894
  case "com.amazonaws.mq#NotFoundException":
2397
- response = {
2398
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2399
- name: errorCode,
2400
- $metadata: deserializeMetadata(output),
2401
- };
2402
- break;
1895
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2403
1896
  default:
2404
1897
  const parsedBody = parsedOutput.body;
2405
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2406
- response = {
2407
- ...parsedBody,
2408
- name: `${errorCode}`,
2409
- message: parsedBody.message || parsedBody.Message || errorCode,
1898
+ response = new MqServiceException_1.MqServiceException({
1899
+ name: parsedBody.code || parsedBody.Code || errorCode,
2410
1900
  $fault: "client",
2411
1901
  $metadata: deserializeMetadata(output),
2412
- };
1902
+ });
1903
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2413
1904
  }
2414
- const message = response.message || response.Message || errorCode;
2415
- response.message = message;
2416
- delete response.Message;
2417
- return Promise.reject(Object.assign(new Error(message), response));
2418
1905
  };
2419
1906
  const deserializeAws_restJson1UpdateConfigurationCommand = async (output, context) => {
2420
1907
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2462,59 +1949,28 @@ const deserializeAws_restJson1UpdateConfigurationCommandError = async (output, c
2462
1949
  switch (errorCode) {
2463
1950
  case "BadRequestException":
2464
1951
  case "com.amazonaws.mq#BadRequestException":
2465
- response = {
2466
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2467
- name: errorCode,
2468
- $metadata: deserializeMetadata(output),
2469
- };
2470
- break;
1952
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2471
1953
  case "ConflictException":
2472
1954
  case "com.amazonaws.mq#ConflictException":
2473
- response = {
2474
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2475
- name: errorCode,
2476
- $metadata: deserializeMetadata(output),
2477
- };
2478
- break;
1955
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2479
1956
  case "ForbiddenException":
2480
1957
  case "com.amazonaws.mq#ForbiddenException":
2481
- response = {
2482
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2483
- name: errorCode,
2484
- $metadata: deserializeMetadata(output),
2485
- };
2486
- break;
1958
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2487
1959
  case "InternalServerErrorException":
2488
1960
  case "com.amazonaws.mq#InternalServerErrorException":
2489
- response = {
2490
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2491
- name: errorCode,
2492
- $metadata: deserializeMetadata(output),
2493
- };
2494
- break;
1961
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2495
1962
  case "NotFoundException":
2496
1963
  case "com.amazonaws.mq#NotFoundException":
2497
- response = {
2498
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2499
- name: errorCode,
2500
- $metadata: deserializeMetadata(output),
2501
- };
2502
- break;
1964
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2503
1965
  default:
2504
1966
  const parsedBody = parsedOutput.body;
2505
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2506
- response = {
2507
- ...parsedBody,
2508
- name: `${errorCode}`,
2509
- message: parsedBody.message || parsedBody.Message || errorCode,
1967
+ response = new MqServiceException_1.MqServiceException({
1968
+ name: parsedBody.code || parsedBody.Code || errorCode,
2510
1969
  $fault: "client",
2511
1970
  $metadata: deserializeMetadata(output),
2512
- };
1971
+ });
1972
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2513
1973
  }
2514
- const message = response.message || response.Message || errorCode;
2515
- response.message = message;
2516
- delete response.Message;
2517
- return Promise.reject(Object.assign(new Error(message), response));
2518
1974
  };
2519
1975
  const deserializeAws_restJson1UpdateUserCommand = async (output, context) => {
2520
1976
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2538,68 +1994,31 @@ const deserializeAws_restJson1UpdateUserCommandError = async (output, context) =
2538
1994
  switch (errorCode) {
2539
1995
  case "BadRequestException":
2540
1996
  case "com.amazonaws.mq#BadRequestException":
2541
- response = {
2542
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2543
- name: errorCode,
2544
- $metadata: deserializeMetadata(output),
2545
- };
2546
- break;
1997
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2547
1998
  case "ConflictException":
2548
1999
  case "com.amazonaws.mq#ConflictException":
2549
- response = {
2550
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2551
- name: errorCode,
2552
- $metadata: deserializeMetadata(output),
2553
- };
2554
- break;
2000
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2555
2001
  case "ForbiddenException":
2556
2002
  case "com.amazonaws.mq#ForbiddenException":
2557
- response = {
2558
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2559
- name: errorCode,
2560
- $metadata: deserializeMetadata(output),
2561
- };
2562
- break;
2003
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2563
2004
  case "InternalServerErrorException":
2564
2005
  case "com.amazonaws.mq#InternalServerErrorException":
2565
- response = {
2566
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2567
- name: errorCode,
2568
- $metadata: deserializeMetadata(output),
2569
- };
2570
- break;
2006
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2571
2007
  case "NotFoundException":
2572
2008
  case "com.amazonaws.mq#NotFoundException":
2573
- response = {
2574
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2575
- name: errorCode,
2576
- $metadata: deserializeMetadata(output),
2577
- };
2578
- break;
2009
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2579
2010
  default:
2580
2011
  const parsedBody = parsedOutput.body;
2581
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2582
- response = {
2583
- ...parsedBody,
2584
- name: `${errorCode}`,
2585
- message: parsedBody.message || parsedBody.Message || errorCode,
2012
+ response = new MqServiceException_1.MqServiceException({
2013
+ name: parsedBody.code || parsedBody.Code || errorCode,
2586
2014
  $fault: "client",
2587
2015
  $metadata: deserializeMetadata(output),
2588
- };
2016
+ });
2017
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2589
2018
  }
2590
- const message = response.message || response.Message || errorCode;
2591
- response.message = message;
2592
- delete response.Message;
2593
- return Promise.reject(Object.assign(new Error(message), response));
2594
2019
  };
2595
2020
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
2596
- const contents = {
2597
- name: "BadRequestException",
2598
- $fault: "client",
2599
- $metadata: deserializeMetadata(parsedOutput),
2600
- ErrorAttribute: undefined,
2601
- Message: undefined,
2602
- };
2021
+ const contents = {};
2603
2022
  const data = parsedOutput.body;
2604
2023
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2605
2024
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2607,16 +2026,14 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
2607
2026
  if (data.message !== undefined && data.message !== null) {
2608
2027
  contents.Message = smithy_client_1.expectString(data.message);
2609
2028
  }
2610
- return contents;
2029
+ const exception = new models_0_1.BadRequestException({
2030
+ $metadata: deserializeMetadata(parsedOutput),
2031
+ ...contents,
2032
+ });
2033
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2611
2034
  };
2612
2035
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2613
- const contents = {
2614
- name: "ConflictException",
2615
- $fault: "client",
2616
- $metadata: deserializeMetadata(parsedOutput),
2617
- ErrorAttribute: undefined,
2618
- Message: undefined,
2619
- };
2036
+ const contents = {};
2620
2037
  const data = parsedOutput.body;
2621
2038
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2622
2039
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2624,16 +2041,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2624
2041
  if (data.message !== undefined && data.message !== null) {
2625
2042
  contents.Message = smithy_client_1.expectString(data.message);
2626
2043
  }
2627
- return contents;
2044
+ const exception = new models_0_1.ConflictException({
2045
+ $metadata: deserializeMetadata(parsedOutput),
2046
+ ...contents,
2047
+ });
2048
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2628
2049
  };
2629
2050
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
2630
- const contents = {
2631
- name: "ForbiddenException",
2632
- $fault: "client",
2633
- $metadata: deserializeMetadata(parsedOutput),
2634
- ErrorAttribute: undefined,
2635
- Message: undefined,
2636
- };
2051
+ const contents = {};
2637
2052
  const data = parsedOutput.body;
2638
2053
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2639
2054
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2641,16 +2056,14 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
2641
2056
  if (data.message !== undefined && data.message !== null) {
2642
2057
  contents.Message = smithy_client_1.expectString(data.message);
2643
2058
  }
2644
- return contents;
2059
+ const exception = new models_0_1.ForbiddenException({
2060
+ $metadata: deserializeMetadata(parsedOutput),
2061
+ ...contents,
2062
+ });
2063
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2645
2064
  };
2646
2065
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
2647
- const contents = {
2648
- name: "InternalServerErrorException",
2649
- $fault: "server",
2650
- $metadata: deserializeMetadata(parsedOutput),
2651
- ErrorAttribute: undefined,
2652
- Message: undefined,
2653
- };
2066
+ const contents = {};
2654
2067
  const data = parsedOutput.body;
2655
2068
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2656
2069
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2658,16 +2071,14 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (pars
2658
2071
  if (data.message !== undefined && data.message !== null) {
2659
2072
  contents.Message = smithy_client_1.expectString(data.message);
2660
2073
  }
2661
- return contents;
2074
+ const exception = new models_0_1.InternalServerErrorException({
2075
+ $metadata: deserializeMetadata(parsedOutput),
2076
+ ...contents,
2077
+ });
2078
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2662
2079
  };
2663
2080
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
2664
- const contents = {
2665
- name: "NotFoundException",
2666
- $fault: "client",
2667
- $metadata: deserializeMetadata(parsedOutput),
2668
- ErrorAttribute: undefined,
2669
- Message: undefined,
2670
- };
2081
+ const contents = {};
2671
2082
  const data = parsedOutput.body;
2672
2083
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2673
2084
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2675,16 +2086,14 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
2675
2086
  if (data.message !== undefined && data.message !== null) {
2676
2087
  contents.Message = smithy_client_1.expectString(data.message);
2677
2088
  }
2678
- return contents;
2089
+ const exception = new models_0_1.NotFoundException({
2090
+ $metadata: deserializeMetadata(parsedOutput),
2091
+ ...contents,
2092
+ });
2093
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2679
2094
  };
2680
2095
  const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
2681
- const contents = {
2682
- name: "UnauthorizedException",
2683
- $fault: "client",
2684
- $metadata: deserializeMetadata(parsedOutput),
2685
- ErrorAttribute: undefined,
2686
- Message: undefined,
2687
- };
2096
+ const contents = {};
2688
2097
  const data = parsedOutput.body;
2689
2098
  if (data.errorAttribute !== undefined && data.errorAttribute !== null) {
2690
2099
  contents.ErrorAttribute = smithy_client_1.expectString(data.errorAttribute);
@@ -2692,7 +2101,11 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutpu
2692
2101
  if (data.message !== undefined && data.message !== null) {
2693
2102
  contents.Message = smithy_client_1.expectString(data.message);
2694
2103
  }
2695
- return contents;
2104
+ const exception = new models_0_1.UnauthorizedException({
2105
+ $metadata: deserializeMetadata(parsedOutput),
2106
+ ...contents,
2107
+ });
2108
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2696
2109
  };
2697
2110
  const serializeAws_restJson1__listOf__string = (input, context) => {
2698
2111
  return input
@@ -2783,7 +2196,7 @@ const serializeAws_restJson1WeeklyStartTime = (input, context) => {
2783
2196
  };
2784
2197
  };
2785
2198
  const deserializeAws_restJson1__listOf__string = (output, context) => {
2786
- return (output || [])
2199
+ const retVal = (output || [])
2787
2200
  .filter((e) => e != null)
2788
2201
  .map((entry) => {
2789
2202
  if (entry === null) {
@@ -2791,9 +2204,10 @@ const deserializeAws_restJson1__listOf__string = (output, context) => {
2791
2204
  }
2792
2205
  return smithy_client_1.expectString(entry);
2793
2206
  });
2207
+ return retVal;
2794
2208
  };
2795
2209
  const deserializeAws_restJson1__listOfAvailabilityZone = (output, context) => {
2796
- return (output || [])
2210
+ const retVal = (output || [])
2797
2211
  .filter((e) => e != null)
2798
2212
  .map((entry) => {
2799
2213
  if (entry === null) {
@@ -2801,9 +2215,10 @@ const deserializeAws_restJson1__listOfAvailabilityZone = (output, context) => {
2801
2215
  }
2802
2216
  return deserializeAws_restJson1AvailabilityZone(entry, context);
2803
2217
  });
2218
+ return retVal;
2804
2219
  };
2805
2220
  const deserializeAws_restJson1__listOfBrokerEngineType = (output, context) => {
2806
- return (output || [])
2221
+ const retVal = (output || [])
2807
2222
  .filter((e) => e != null)
2808
2223
  .map((entry) => {
2809
2224
  if (entry === null) {
@@ -2811,9 +2226,10 @@ const deserializeAws_restJson1__listOfBrokerEngineType = (output, context) => {
2811
2226
  }
2812
2227
  return deserializeAws_restJson1BrokerEngineType(entry, context);
2813
2228
  });
2229
+ return retVal;
2814
2230
  };
2815
2231
  const deserializeAws_restJson1__listOfBrokerInstance = (output, context) => {
2816
- return (output || [])
2232
+ const retVal = (output || [])
2817
2233
  .filter((e) => e != null)
2818
2234
  .map((entry) => {
2819
2235
  if (entry === null) {
@@ -2821,9 +2237,10 @@ const deserializeAws_restJson1__listOfBrokerInstance = (output, context) => {
2821
2237
  }
2822
2238
  return deserializeAws_restJson1BrokerInstance(entry, context);
2823
2239
  });
2240
+ return retVal;
2824
2241
  };
2825
2242
  const deserializeAws_restJson1__listOfBrokerInstanceOption = (output, context) => {
2826
- return (output || [])
2243
+ const retVal = (output || [])
2827
2244
  .filter((e) => e != null)
2828
2245
  .map((entry) => {
2829
2246
  if (entry === null) {
@@ -2831,9 +2248,10 @@ const deserializeAws_restJson1__listOfBrokerInstanceOption = (output, context) =
2831
2248
  }
2832
2249
  return deserializeAws_restJson1BrokerInstanceOption(entry, context);
2833
2250
  });
2251
+ return retVal;
2834
2252
  };
2835
2253
  const deserializeAws_restJson1__listOfBrokerSummary = (output, context) => {
2836
- return (output || [])
2254
+ const retVal = (output || [])
2837
2255
  .filter((e) => e != null)
2838
2256
  .map((entry) => {
2839
2257
  if (entry === null) {
@@ -2841,9 +2259,10 @@ const deserializeAws_restJson1__listOfBrokerSummary = (output, context) => {
2841
2259
  }
2842
2260
  return deserializeAws_restJson1BrokerSummary(entry, context);
2843
2261
  });
2262
+ return retVal;
2844
2263
  };
2845
2264
  const deserializeAws_restJson1__listOfConfiguration = (output, context) => {
2846
- return (output || [])
2265
+ const retVal = (output || [])
2847
2266
  .filter((e) => e != null)
2848
2267
  .map((entry) => {
2849
2268
  if (entry === null) {
@@ -2851,9 +2270,10 @@ const deserializeAws_restJson1__listOfConfiguration = (output, context) => {
2851
2270
  }
2852
2271
  return deserializeAws_restJson1Configuration(entry, context);
2853
2272
  });
2273
+ return retVal;
2854
2274
  };
2855
2275
  const deserializeAws_restJson1__listOfConfigurationId = (output, context) => {
2856
- return (output || [])
2276
+ const retVal = (output || [])
2857
2277
  .filter((e) => e != null)
2858
2278
  .map((entry) => {
2859
2279
  if (entry === null) {
@@ -2861,9 +2281,10 @@ const deserializeAws_restJson1__listOfConfigurationId = (output, context) => {
2861
2281
  }
2862
2282
  return deserializeAws_restJson1ConfigurationId(entry, context);
2863
2283
  });
2284
+ return retVal;
2864
2285
  };
2865
2286
  const deserializeAws_restJson1__listOfConfigurationRevision = (output, context) => {
2866
- return (output || [])
2287
+ const retVal = (output || [])
2867
2288
  .filter((e) => e != null)
2868
2289
  .map((entry) => {
2869
2290
  if (entry === null) {
@@ -2871,9 +2292,10 @@ const deserializeAws_restJson1__listOfConfigurationRevision = (output, context)
2871
2292
  }
2872
2293
  return deserializeAws_restJson1ConfigurationRevision(entry, context);
2873
2294
  });
2295
+ return retVal;
2874
2296
  };
2875
2297
  const deserializeAws_restJson1__listOfDeploymentMode = (output, context) => {
2876
- return (output || [])
2298
+ const retVal = (output || [])
2877
2299
  .filter((e) => e != null)
2878
2300
  .map((entry) => {
2879
2301
  if (entry === null) {
@@ -2881,9 +2303,10 @@ const deserializeAws_restJson1__listOfDeploymentMode = (output, context) => {
2881
2303
  }
2882
2304
  return smithy_client_1.expectString(entry);
2883
2305
  });
2306
+ return retVal;
2884
2307
  };
2885
2308
  const deserializeAws_restJson1__listOfEngineVersion = (output, context) => {
2886
- return (output || [])
2309
+ const retVal = (output || [])
2887
2310
  .filter((e) => e != null)
2888
2311
  .map((entry) => {
2889
2312
  if (entry === null) {
@@ -2891,9 +2314,10 @@ const deserializeAws_restJson1__listOfEngineVersion = (output, context) => {
2891
2314
  }
2892
2315
  return deserializeAws_restJson1EngineVersion(entry, context);
2893
2316
  });
2317
+ return retVal;
2894
2318
  };
2895
2319
  const deserializeAws_restJson1__listOfSanitizationWarning = (output, context) => {
2896
- return (output || [])
2320
+ const retVal = (output || [])
2897
2321
  .filter((e) => e != null)
2898
2322
  .map((entry) => {
2899
2323
  if (entry === null) {
@@ -2901,9 +2325,10 @@ const deserializeAws_restJson1__listOfSanitizationWarning = (output, context) =>
2901
2325
  }
2902
2326
  return deserializeAws_restJson1SanitizationWarning(entry, context);
2903
2327
  });
2328
+ return retVal;
2904
2329
  };
2905
2330
  const deserializeAws_restJson1__listOfUserSummary = (output, context) => {
2906
- return (output || [])
2331
+ const retVal = (output || [])
2907
2332
  .filter((e) => e != null)
2908
2333
  .map((entry) => {
2909
2334
  if (entry === null) {
@@ -2911,6 +2336,7 @@ const deserializeAws_restJson1__listOfUserSummary = (output, context) => {
2911
2336
  }
2912
2337
  return deserializeAws_restJson1UserSummary(entry, context);
2913
2338
  });
2339
+ return retVal;
2914
2340
  };
2915
2341
  const deserializeAws_restJson1__mapOf__string = (output, context) => {
2916
2342
  return Object.entries(output).reduce((acc, [key, value]) => {