@aws-sdk/client-signer 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_restJson1UntagResourceCommand = exports.deserializeAws_re
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 SignerServiceException_1 = require("../models/SignerServiceException");
7
9
  const serializeAws_restJson1AddProfilePermissionCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {
@@ -557,75 +559,34 @@ const deserializeAws_restJson1AddProfilePermissionCommandError = async (output,
557
559
  switch (errorCode) {
558
560
  case "AccessDeniedException":
559
561
  case "com.amazonaws.signer#AccessDeniedException":
560
- response = {
561
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
562
- name: errorCode,
563
- $metadata: deserializeMetadata(output),
564
- };
565
- break;
562
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
566
563
  case "ConflictException":
567
564
  case "com.amazonaws.signer#ConflictException":
568
- response = {
569
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
570
- name: errorCode,
571
- $metadata: deserializeMetadata(output),
572
- };
573
- break;
565
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
574
566
  case "InternalServiceErrorException":
575
567
  case "com.amazonaws.signer#InternalServiceErrorException":
576
- response = {
577
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
578
- name: errorCode,
579
- $metadata: deserializeMetadata(output),
580
- };
581
- break;
568
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
582
569
  case "ResourceNotFoundException":
583
570
  case "com.amazonaws.signer#ResourceNotFoundException":
584
- response = {
585
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
586
- name: errorCode,
587
- $metadata: deserializeMetadata(output),
588
- };
589
- break;
571
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
590
572
  case "ServiceLimitExceededException":
591
573
  case "com.amazonaws.signer#ServiceLimitExceededException":
592
- response = {
593
- ...(await deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)),
594
- name: errorCode,
595
- $metadata: deserializeMetadata(output),
596
- };
597
- break;
574
+ throw await deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context);
598
575
  case "TooManyRequestsException":
599
576
  case "com.amazonaws.signer#TooManyRequestsException":
600
- response = {
601
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
602
- name: errorCode,
603
- $metadata: deserializeMetadata(output),
604
- };
605
- break;
577
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
606
578
  case "ValidationException":
607
579
  case "com.amazonaws.signer#ValidationException":
608
- response = {
609
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
610
- name: errorCode,
611
- $metadata: deserializeMetadata(output),
612
- };
613
- break;
580
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
614
581
  default:
615
582
  const parsedBody = parsedOutput.body;
616
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
617
- response = {
618
- ...parsedBody,
619
- name: `${errorCode}`,
620
- message: parsedBody.message || parsedBody.Message || errorCode,
583
+ response = new SignerServiceException_1.SignerServiceException({
584
+ name: parsedBody.code || parsedBody.Code || errorCode,
621
585
  $fault: "client",
622
586
  $metadata: deserializeMetadata(output),
623
- };
587
+ });
588
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
624
589
  }
625
- const message = response.message || response.Message || errorCode;
626
- response.message = message;
627
- delete response.Message;
628
- return Promise.reject(Object.assign(new Error(message), response));
629
590
  };
630
591
  const deserializeAws_restJson1CancelSigningProfileCommand = async (output, context) => {
631
592
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -649,51 +610,25 @@ const deserializeAws_restJson1CancelSigningProfileCommandError = async (output,
649
610
  switch (errorCode) {
650
611
  case "AccessDeniedException":
651
612
  case "com.amazonaws.signer#AccessDeniedException":
652
- response = {
653
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
654
- name: errorCode,
655
- $metadata: deserializeMetadata(output),
656
- };
657
- break;
613
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
658
614
  case "InternalServiceErrorException":
659
615
  case "com.amazonaws.signer#InternalServiceErrorException":
660
- response = {
661
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
662
- name: errorCode,
663
- $metadata: deserializeMetadata(output),
664
- };
665
- break;
616
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
666
617
  case "ResourceNotFoundException":
667
618
  case "com.amazonaws.signer#ResourceNotFoundException":
668
- response = {
669
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
670
- name: errorCode,
671
- $metadata: deserializeMetadata(output),
672
- };
673
- break;
619
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
674
620
  case "TooManyRequestsException":
675
621
  case "com.amazonaws.signer#TooManyRequestsException":
676
- response = {
677
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
678
- name: errorCode,
679
- $metadata: deserializeMetadata(output),
680
- };
681
- break;
622
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
682
623
  default:
683
624
  const parsedBody = parsedOutput.body;
684
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
685
- response = {
686
- ...parsedBody,
687
- name: `${errorCode}`,
688
- message: parsedBody.message || parsedBody.Message || errorCode,
625
+ response = new SignerServiceException_1.SignerServiceException({
626
+ name: parsedBody.code || parsedBody.Code || errorCode,
689
627
  $fault: "client",
690
628
  $metadata: deserializeMetadata(output),
691
- };
629
+ });
630
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
692
631
  }
693
- const message = response.message || response.Message || errorCode;
694
- response.message = message;
695
- delete response.Message;
696
- return Promise.reject(Object.assign(new Error(message), response));
697
632
  };
698
633
  const deserializeAws_restJson1DescribeSigningJobCommand = async (output, context) => {
699
634
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -793,51 +728,25 @@ const deserializeAws_restJson1DescribeSigningJobCommandError = async (output, co
793
728
  switch (errorCode) {
794
729
  case "AccessDeniedException":
795
730
  case "com.amazonaws.signer#AccessDeniedException":
796
- response = {
797
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
798
- name: errorCode,
799
- $metadata: deserializeMetadata(output),
800
- };
801
- break;
731
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
802
732
  case "InternalServiceErrorException":
803
733
  case "com.amazonaws.signer#InternalServiceErrorException":
804
- response = {
805
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
806
- name: errorCode,
807
- $metadata: deserializeMetadata(output),
808
- };
809
- break;
734
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
810
735
  case "ResourceNotFoundException":
811
736
  case "com.amazonaws.signer#ResourceNotFoundException":
812
- response = {
813
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
814
- name: errorCode,
815
- $metadata: deserializeMetadata(output),
816
- };
817
- break;
737
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
818
738
  case "TooManyRequestsException":
819
739
  case "com.amazonaws.signer#TooManyRequestsException":
820
- response = {
821
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
822
- name: errorCode,
823
- $metadata: deserializeMetadata(output),
824
- };
825
- break;
740
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
826
741
  default:
827
742
  const parsedBody = parsedOutput.body;
828
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
829
- response = {
830
- ...parsedBody,
831
- name: `${errorCode}`,
832
- message: parsedBody.message || parsedBody.Message || errorCode,
743
+ response = new SignerServiceException_1.SignerServiceException({
744
+ name: parsedBody.code || parsedBody.Code || errorCode,
833
745
  $fault: "client",
834
746
  $metadata: deserializeMetadata(output),
835
- };
747
+ });
748
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
836
749
  }
837
- const message = response.message || response.Message || errorCode;
838
- response.message = message;
839
- delete response.Message;
840
- return Promise.reject(Object.assign(new Error(message), response));
841
750
  };
842
751
  const deserializeAws_restJson1GetSigningPlatformCommand = async (output, context) => {
843
752
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -897,51 +806,25 @@ const deserializeAws_restJson1GetSigningPlatformCommandError = async (output, co
897
806
  switch (errorCode) {
898
807
  case "AccessDeniedException":
899
808
  case "com.amazonaws.signer#AccessDeniedException":
900
- response = {
901
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
902
- name: errorCode,
903
- $metadata: deserializeMetadata(output),
904
- };
905
- break;
809
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
906
810
  case "InternalServiceErrorException":
907
811
  case "com.amazonaws.signer#InternalServiceErrorException":
908
- response = {
909
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
910
- name: errorCode,
911
- $metadata: deserializeMetadata(output),
912
- };
913
- break;
812
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
914
813
  case "ResourceNotFoundException":
915
814
  case "com.amazonaws.signer#ResourceNotFoundException":
916
- response = {
917
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
918
- name: errorCode,
919
- $metadata: deserializeMetadata(output),
920
- };
921
- break;
815
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
922
816
  case "TooManyRequestsException":
923
817
  case "com.amazonaws.signer#TooManyRequestsException":
924
- response = {
925
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
926
- name: errorCode,
927
- $metadata: deserializeMetadata(output),
928
- };
929
- break;
818
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
930
819
  default:
931
820
  const parsedBody = parsedOutput.body;
932
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
933
- response = {
934
- ...parsedBody,
935
- name: `${errorCode}`,
936
- message: parsedBody.message || parsedBody.Message || errorCode,
821
+ response = new SignerServiceException_1.SignerServiceException({
822
+ name: parsedBody.code || parsedBody.Code || errorCode,
937
823
  $fault: "client",
938
824
  $metadata: deserializeMetadata(output),
939
- };
825
+ });
826
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
940
827
  }
941
- const message = response.message || response.Message || errorCode;
942
- response.message = message;
943
- delete response.Message;
944
- return Promise.reject(Object.assign(new Error(message), response));
945
828
  };
946
829
  const deserializeAws_restJson1GetSigningProfileCommand = async (output, context) => {
947
830
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1021,51 +904,25 @@ const deserializeAws_restJson1GetSigningProfileCommandError = async (output, con
1021
904
  switch (errorCode) {
1022
905
  case "AccessDeniedException":
1023
906
  case "com.amazonaws.signer#AccessDeniedException":
1024
- response = {
1025
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1026
- name: errorCode,
1027
- $metadata: deserializeMetadata(output),
1028
- };
1029
- break;
907
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1030
908
  case "InternalServiceErrorException":
1031
909
  case "com.amazonaws.signer#InternalServiceErrorException":
1032
- response = {
1033
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1034
- name: errorCode,
1035
- $metadata: deserializeMetadata(output),
1036
- };
1037
- break;
910
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1038
911
  case "ResourceNotFoundException":
1039
912
  case "com.amazonaws.signer#ResourceNotFoundException":
1040
- response = {
1041
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1042
- name: errorCode,
1043
- $metadata: deserializeMetadata(output),
1044
- };
1045
- break;
913
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1046
914
  case "TooManyRequestsException":
1047
915
  case "com.amazonaws.signer#TooManyRequestsException":
1048
- response = {
1049
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1050
- name: errorCode,
1051
- $metadata: deserializeMetadata(output),
1052
- };
1053
- break;
916
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1054
917
  default:
1055
918
  const parsedBody = parsedOutput.body;
1056
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1057
- response = {
1058
- ...parsedBody,
1059
- name: `${errorCode}`,
1060
- message: parsedBody.message || parsedBody.Message || errorCode,
919
+ response = new SignerServiceException_1.SignerServiceException({
920
+ name: parsedBody.code || parsedBody.Code || errorCode,
1061
921
  $fault: "client",
1062
922
  $metadata: deserializeMetadata(output),
1063
- };
923
+ });
924
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1064
925
  }
1065
- const message = response.message || response.Message || errorCode;
1066
- response.message = message;
1067
- delete response.Message;
1068
- return Promise.reject(Object.assign(new Error(message), response));
1069
926
  };
1070
927
  const deserializeAws_restJson1ListProfilePermissionsCommand = async (output, context) => {
1071
928
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1105,59 +962,28 @@ const deserializeAws_restJson1ListProfilePermissionsCommandError = async (output
1105
962
  switch (errorCode) {
1106
963
  case "AccessDeniedException":
1107
964
  case "com.amazonaws.signer#AccessDeniedException":
1108
- response = {
1109
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1110
- name: errorCode,
1111
- $metadata: deserializeMetadata(output),
1112
- };
1113
- break;
965
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1114
966
  case "InternalServiceErrorException":
1115
967
  case "com.amazonaws.signer#InternalServiceErrorException":
1116
- response = {
1117
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1118
- name: errorCode,
1119
- $metadata: deserializeMetadata(output),
1120
- };
1121
- break;
968
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1122
969
  case "ResourceNotFoundException":
1123
970
  case "com.amazonaws.signer#ResourceNotFoundException":
1124
- response = {
1125
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1126
- name: errorCode,
1127
- $metadata: deserializeMetadata(output),
1128
- };
1129
- break;
971
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1130
972
  case "TooManyRequestsException":
1131
973
  case "com.amazonaws.signer#TooManyRequestsException":
1132
- response = {
1133
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1134
- name: errorCode,
1135
- $metadata: deserializeMetadata(output),
1136
- };
1137
- break;
974
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1138
975
  case "ValidationException":
1139
976
  case "com.amazonaws.signer#ValidationException":
1140
- response = {
1141
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1142
- name: errorCode,
1143
- $metadata: deserializeMetadata(output),
1144
- };
1145
- break;
977
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1146
978
  default:
1147
979
  const parsedBody = parsedOutput.body;
1148
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1149
- response = {
1150
- ...parsedBody,
1151
- name: `${errorCode}`,
1152
- message: parsedBody.message || parsedBody.Message || errorCode,
980
+ response = new SignerServiceException_1.SignerServiceException({
981
+ name: parsedBody.code || parsedBody.Code || errorCode,
1153
982
  $fault: "client",
1154
983
  $metadata: deserializeMetadata(output),
1155
- };
984
+ });
985
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1156
986
  }
1157
- const message = response.message || response.Message || errorCode;
1158
- response.message = message;
1159
- delete response.Message;
1160
- return Promise.reject(Object.assign(new Error(message), response));
1161
987
  };
1162
988
  const deserializeAws_restJson1ListSigningJobsCommand = async (output, context) => {
1163
989
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1189,51 +1015,25 @@ const deserializeAws_restJson1ListSigningJobsCommandError = async (output, conte
1189
1015
  switch (errorCode) {
1190
1016
  case "AccessDeniedException":
1191
1017
  case "com.amazonaws.signer#AccessDeniedException":
1192
- response = {
1193
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1194
- name: errorCode,
1195
- $metadata: deserializeMetadata(output),
1196
- };
1197
- break;
1018
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1198
1019
  case "InternalServiceErrorException":
1199
1020
  case "com.amazonaws.signer#InternalServiceErrorException":
1200
- response = {
1201
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1202
- name: errorCode,
1203
- $metadata: deserializeMetadata(output),
1204
- };
1205
- break;
1021
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1206
1022
  case "TooManyRequestsException":
1207
1023
  case "com.amazonaws.signer#TooManyRequestsException":
1208
- response = {
1209
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1210
- name: errorCode,
1211
- $metadata: deserializeMetadata(output),
1212
- };
1213
- break;
1024
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1214
1025
  case "ValidationException":
1215
1026
  case "com.amazonaws.signer#ValidationException":
1216
- response = {
1217
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1218
- name: errorCode,
1219
- $metadata: deserializeMetadata(output),
1220
- };
1221
- break;
1027
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1222
1028
  default:
1223
1029
  const parsedBody = parsedOutput.body;
1224
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1225
- response = {
1226
- ...parsedBody,
1227
- name: `${errorCode}`,
1228
- message: parsedBody.message || parsedBody.Message || errorCode,
1030
+ response = new SignerServiceException_1.SignerServiceException({
1031
+ name: parsedBody.code || parsedBody.Code || errorCode,
1229
1032
  $fault: "client",
1230
1033
  $metadata: deserializeMetadata(output),
1231
- };
1034
+ });
1035
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1232
1036
  }
1233
- const message = response.message || response.Message || errorCode;
1234
- response.message = message;
1235
- delete response.Message;
1236
- return Promise.reject(Object.assign(new Error(message), response));
1237
1037
  };
1238
1038
  const deserializeAws_restJson1ListSigningPlatformsCommand = async (output, context) => {
1239
1039
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1265,51 +1065,25 @@ const deserializeAws_restJson1ListSigningPlatformsCommandError = async (output,
1265
1065
  switch (errorCode) {
1266
1066
  case "AccessDeniedException":
1267
1067
  case "com.amazonaws.signer#AccessDeniedException":
1268
- response = {
1269
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1270
- name: errorCode,
1271
- $metadata: deserializeMetadata(output),
1272
- };
1273
- break;
1068
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1274
1069
  case "InternalServiceErrorException":
1275
1070
  case "com.amazonaws.signer#InternalServiceErrorException":
1276
- response = {
1277
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1278
- name: errorCode,
1279
- $metadata: deserializeMetadata(output),
1280
- };
1281
- break;
1071
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1282
1072
  case "TooManyRequestsException":
1283
1073
  case "com.amazonaws.signer#TooManyRequestsException":
1284
- response = {
1285
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1286
- name: errorCode,
1287
- $metadata: deserializeMetadata(output),
1288
- };
1289
- break;
1074
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1290
1075
  case "ValidationException":
1291
1076
  case "com.amazonaws.signer#ValidationException":
1292
- response = {
1293
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1294
- name: errorCode,
1295
- $metadata: deserializeMetadata(output),
1296
- };
1297
- break;
1077
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1298
1078
  default:
1299
1079
  const parsedBody = parsedOutput.body;
1300
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1301
- response = {
1302
- ...parsedBody,
1303
- name: `${errorCode}`,
1304
- message: parsedBody.message || parsedBody.Message || errorCode,
1080
+ response = new SignerServiceException_1.SignerServiceException({
1081
+ name: parsedBody.code || parsedBody.Code || errorCode,
1305
1082
  $fault: "client",
1306
1083
  $metadata: deserializeMetadata(output),
1307
- };
1084
+ });
1085
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1308
1086
  }
1309
- const message = response.message || response.Message || errorCode;
1310
- response.message = message;
1311
- delete response.Message;
1312
- return Promise.reject(Object.assign(new Error(message), response));
1313
1087
  };
1314
1088
  const deserializeAws_restJson1ListSigningProfilesCommand = async (output, context) => {
1315
1089
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1341,43 +1115,22 @@ const deserializeAws_restJson1ListSigningProfilesCommandError = async (output, c
1341
1115
  switch (errorCode) {
1342
1116
  case "AccessDeniedException":
1343
1117
  case "com.amazonaws.signer#AccessDeniedException":
1344
- response = {
1345
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1346
- name: errorCode,
1347
- $metadata: deserializeMetadata(output),
1348
- };
1349
- break;
1118
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1350
1119
  case "InternalServiceErrorException":
1351
1120
  case "com.amazonaws.signer#InternalServiceErrorException":
1352
- response = {
1353
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1354
- name: errorCode,
1355
- $metadata: deserializeMetadata(output),
1356
- };
1357
- break;
1121
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1358
1122
  case "TooManyRequestsException":
1359
1123
  case "com.amazonaws.signer#TooManyRequestsException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1124
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1366
1125
  default:
1367
1126
  const parsedBody = parsedOutput.body;
1368
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1369
- response = {
1370
- ...parsedBody,
1371
- name: `${errorCode}`,
1372
- message: parsedBody.message || parsedBody.Message || errorCode,
1127
+ response = new SignerServiceException_1.SignerServiceException({
1128
+ name: parsedBody.code || parsedBody.Code || errorCode,
1373
1129
  $fault: "client",
1374
1130
  $metadata: deserializeMetadata(output),
1375
- };
1131
+ });
1132
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1376
1133
  }
1377
- const message = response.message || response.Message || errorCode;
1378
- response.message = message;
1379
- delete response.Message;
1380
- return Promise.reject(Object.assign(new Error(message), response));
1381
1134
  };
1382
1135
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1383
1136
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1405,51 +1158,25 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1405
1158
  switch (errorCode) {
1406
1159
  case "BadRequestException":
1407
1160
  case "com.amazonaws.signer#BadRequestException":
1408
- response = {
1409
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1410
- name: errorCode,
1411
- $metadata: deserializeMetadata(output),
1412
- };
1413
- break;
1161
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1414
1162
  case "InternalServiceErrorException":
1415
1163
  case "com.amazonaws.signer#InternalServiceErrorException":
1416
- response = {
1417
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1418
- name: errorCode,
1419
- $metadata: deserializeMetadata(output),
1420
- };
1421
- break;
1164
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1422
1165
  case "NotFoundException":
1423
1166
  case "com.amazonaws.signer#NotFoundException":
1424
- response = {
1425
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1426
- name: errorCode,
1427
- $metadata: deserializeMetadata(output),
1428
- };
1429
- break;
1167
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1430
1168
  case "TooManyRequestsException":
1431
1169
  case "com.amazonaws.signer#TooManyRequestsException":
1432
- response = {
1433
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1434
- name: errorCode,
1435
- $metadata: deserializeMetadata(output),
1436
- };
1437
- break;
1170
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1438
1171
  default:
1439
1172
  const parsedBody = parsedOutput.body;
1440
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1441
- response = {
1442
- ...parsedBody,
1443
- name: `${errorCode}`,
1444
- message: parsedBody.message || parsedBody.Message || errorCode,
1173
+ response = new SignerServiceException_1.SignerServiceException({
1174
+ name: parsedBody.code || parsedBody.Code || errorCode,
1445
1175
  $fault: "client",
1446
1176
  $metadata: deserializeMetadata(output),
1447
- };
1177
+ });
1178
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1448
1179
  }
1449
- const message = response.message || response.Message || errorCode;
1450
- response.message = message;
1451
- delete response.Message;
1452
- return Promise.reject(Object.assign(new Error(message), response));
1453
1180
  };
1454
1181
  const deserializeAws_restJson1PutSigningProfileCommand = async (output, context) => {
1455
1182
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1485,59 +1212,28 @@ const deserializeAws_restJson1PutSigningProfileCommandError = async (output, con
1485
1212
  switch (errorCode) {
1486
1213
  case "AccessDeniedException":
1487
1214
  case "com.amazonaws.signer#AccessDeniedException":
1488
- response = {
1489
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1490
- name: errorCode,
1491
- $metadata: deserializeMetadata(output),
1492
- };
1493
- break;
1215
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1494
1216
  case "InternalServiceErrorException":
1495
1217
  case "com.amazonaws.signer#InternalServiceErrorException":
1496
- response = {
1497
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1498
- name: errorCode,
1499
- $metadata: deserializeMetadata(output),
1500
- };
1501
- break;
1218
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1502
1219
  case "ResourceNotFoundException":
1503
1220
  case "com.amazonaws.signer#ResourceNotFoundException":
1504
- response = {
1505
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1506
- name: errorCode,
1507
- $metadata: deserializeMetadata(output),
1508
- };
1509
- break;
1221
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1510
1222
  case "TooManyRequestsException":
1511
1223
  case "com.amazonaws.signer#TooManyRequestsException":
1512
- response = {
1513
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1514
- name: errorCode,
1515
- $metadata: deserializeMetadata(output),
1516
- };
1517
- break;
1224
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1518
1225
  case "ValidationException":
1519
1226
  case "com.amazonaws.signer#ValidationException":
1520
- response = {
1521
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1522
- name: errorCode,
1523
- $metadata: deserializeMetadata(output),
1524
- };
1525
- break;
1227
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1526
1228
  default:
1527
1229
  const parsedBody = parsedOutput.body;
1528
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1529
- response = {
1530
- ...parsedBody,
1531
- name: `${errorCode}`,
1532
- message: parsedBody.message || parsedBody.Message || errorCode,
1230
+ response = new SignerServiceException_1.SignerServiceException({
1231
+ name: parsedBody.code || parsedBody.Code || errorCode,
1533
1232
  $fault: "client",
1534
1233
  $metadata: deserializeMetadata(output),
1535
- };
1234
+ });
1235
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1536
1236
  }
1537
- const message = response.message || response.Message || errorCode;
1538
- response.message = message;
1539
- delete response.Message;
1540
- return Promise.reject(Object.assign(new Error(message), response));
1541
1237
  };
1542
1238
  const deserializeAws_restJson1RemoveProfilePermissionCommand = async (output, context) => {
1543
1239
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1565,67 +1261,31 @@ const deserializeAws_restJson1RemoveProfilePermissionCommandError = async (outpu
1565
1261
  switch (errorCode) {
1566
1262
  case "AccessDeniedException":
1567
1263
  case "com.amazonaws.signer#AccessDeniedException":
1568
- response = {
1569
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1570
- name: errorCode,
1571
- $metadata: deserializeMetadata(output),
1572
- };
1573
- break;
1264
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1574
1265
  case "ConflictException":
1575
1266
  case "com.amazonaws.signer#ConflictException":
1576
- response = {
1577
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1578
- name: errorCode,
1579
- $metadata: deserializeMetadata(output),
1580
- };
1581
- break;
1267
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1582
1268
  case "InternalServiceErrorException":
1583
1269
  case "com.amazonaws.signer#InternalServiceErrorException":
1584
- response = {
1585
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1586
- name: errorCode,
1587
- $metadata: deserializeMetadata(output),
1588
- };
1589
- break;
1270
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1590
1271
  case "ResourceNotFoundException":
1591
1272
  case "com.amazonaws.signer#ResourceNotFoundException":
1592
- response = {
1593
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1594
- name: errorCode,
1595
- $metadata: deserializeMetadata(output),
1596
- };
1597
- break;
1273
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1598
1274
  case "TooManyRequestsException":
1599
1275
  case "com.amazonaws.signer#TooManyRequestsException":
1600
- response = {
1601
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1602
- name: errorCode,
1603
- $metadata: deserializeMetadata(output),
1604
- };
1605
- break;
1276
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1606
1277
  case "ValidationException":
1607
1278
  case "com.amazonaws.signer#ValidationException":
1608
- response = {
1609
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1610
- name: errorCode,
1611
- $metadata: deserializeMetadata(output),
1612
- };
1613
- break;
1279
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1614
1280
  default:
1615
1281
  const parsedBody = parsedOutput.body;
1616
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1617
- response = {
1618
- ...parsedBody,
1619
- name: `${errorCode}`,
1620
- message: parsedBody.message || parsedBody.Message || errorCode,
1282
+ response = new SignerServiceException_1.SignerServiceException({
1283
+ name: parsedBody.code || parsedBody.Code || errorCode,
1621
1284
  $fault: "client",
1622
1285
  $metadata: deserializeMetadata(output),
1623
- };
1286
+ });
1287
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1624
1288
  }
1625
- const message = response.message || response.Message || errorCode;
1626
- response.message = message;
1627
- delete response.Message;
1628
- return Promise.reject(Object.assign(new Error(message), response));
1629
1289
  };
1630
1290
  const deserializeAws_restJson1RevokeSignatureCommand = async (output, context) => {
1631
1291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1649,59 +1309,28 @@ const deserializeAws_restJson1RevokeSignatureCommandError = async (output, conte
1649
1309
  switch (errorCode) {
1650
1310
  case "AccessDeniedException":
1651
1311
  case "com.amazonaws.signer#AccessDeniedException":
1652
- response = {
1653
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1654
- name: errorCode,
1655
- $metadata: deserializeMetadata(output),
1656
- };
1657
- break;
1312
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1658
1313
  case "InternalServiceErrorException":
1659
1314
  case "com.amazonaws.signer#InternalServiceErrorException":
1660
- response = {
1661
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1662
- name: errorCode,
1663
- $metadata: deserializeMetadata(output),
1664
- };
1665
- break;
1315
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1666
1316
  case "ResourceNotFoundException":
1667
1317
  case "com.amazonaws.signer#ResourceNotFoundException":
1668
- response = {
1669
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1670
- name: errorCode,
1671
- $metadata: deserializeMetadata(output),
1672
- };
1673
- break;
1318
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1674
1319
  case "TooManyRequestsException":
1675
1320
  case "com.amazonaws.signer#TooManyRequestsException":
1676
- response = {
1677
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1678
- name: errorCode,
1679
- $metadata: deserializeMetadata(output),
1680
- };
1681
- break;
1321
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1682
1322
  case "ValidationException":
1683
1323
  case "com.amazonaws.signer#ValidationException":
1684
- response = {
1685
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1686
- name: errorCode,
1687
- $metadata: deserializeMetadata(output),
1688
- };
1689
- break;
1324
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1690
1325
  default:
1691
1326
  const parsedBody = parsedOutput.body;
1692
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1693
- response = {
1694
- ...parsedBody,
1695
- name: `${errorCode}`,
1696
- message: parsedBody.message || parsedBody.Message || errorCode,
1327
+ response = new SignerServiceException_1.SignerServiceException({
1328
+ name: parsedBody.code || parsedBody.Code || errorCode,
1697
1329
  $fault: "client",
1698
1330
  $metadata: deserializeMetadata(output),
1699
- };
1331
+ });
1332
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1700
1333
  }
1701
- const message = response.message || response.Message || errorCode;
1702
- response.message = message;
1703
- delete response.Message;
1704
- return Promise.reject(Object.assign(new Error(message), response));
1705
1334
  };
1706
1335
  const deserializeAws_restJson1RevokeSigningProfileCommand = async (output, context) => {
1707
1336
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1725,59 +1354,28 @@ const deserializeAws_restJson1RevokeSigningProfileCommandError = async (output,
1725
1354
  switch (errorCode) {
1726
1355
  case "AccessDeniedException":
1727
1356
  case "com.amazonaws.signer#AccessDeniedException":
1728
- response = {
1729
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1730
- name: errorCode,
1731
- $metadata: deserializeMetadata(output),
1732
- };
1733
- break;
1357
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1734
1358
  case "InternalServiceErrorException":
1735
1359
  case "com.amazonaws.signer#InternalServiceErrorException":
1736
- response = {
1737
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1738
- name: errorCode,
1739
- $metadata: deserializeMetadata(output),
1740
- };
1741
- break;
1360
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1742
1361
  case "ResourceNotFoundException":
1743
1362
  case "com.amazonaws.signer#ResourceNotFoundException":
1744
- response = {
1745
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1746
- name: errorCode,
1747
- $metadata: deserializeMetadata(output),
1748
- };
1749
- break;
1363
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1750
1364
  case "TooManyRequestsException":
1751
1365
  case "com.amazonaws.signer#TooManyRequestsException":
1752
- response = {
1753
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1754
- name: errorCode,
1755
- $metadata: deserializeMetadata(output),
1756
- };
1757
- break;
1366
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1758
1367
  case "ValidationException":
1759
1368
  case "com.amazonaws.signer#ValidationException":
1760
- response = {
1761
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1762
- name: errorCode,
1763
- $metadata: deserializeMetadata(output),
1764
- };
1765
- break;
1369
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1766
1370
  default:
1767
1371
  const parsedBody = parsedOutput.body;
1768
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1769
- response = {
1770
- ...parsedBody,
1771
- name: `${errorCode}`,
1772
- message: parsedBody.message || parsedBody.Message || errorCode,
1372
+ response = new SignerServiceException_1.SignerServiceException({
1373
+ name: parsedBody.code || parsedBody.Code || errorCode,
1773
1374
  $fault: "client",
1774
1375
  $metadata: deserializeMetadata(output),
1775
- };
1376
+ });
1377
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1776
1378
  }
1777
- const message = response.message || response.Message || errorCode;
1778
- response.message = message;
1779
- delete response.Message;
1780
- return Promise.reject(Object.assign(new Error(message), response));
1781
1379
  };
1782
1380
  const deserializeAws_restJson1StartSigningJobCommand = async (output, context) => {
1783
1381
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1809,67 +1407,31 @@ const deserializeAws_restJson1StartSigningJobCommandError = async (output, conte
1809
1407
  switch (errorCode) {
1810
1408
  case "AccessDeniedException":
1811
1409
  case "com.amazonaws.signer#AccessDeniedException":
1812
- response = {
1813
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1814
- name: errorCode,
1815
- $metadata: deserializeMetadata(output),
1816
- };
1817
- break;
1410
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1818
1411
  case "InternalServiceErrorException":
1819
1412
  case "com.amazonaws.signer#InternalServiceErrorException":
1820
- response = {
1821
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1413
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1826
1414
  case "ResourceNotFoundException":
1827
1415
  case "com.amazonaws.signer#ResourceNotFoundException":
1828
- response = {
1829
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1416
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1834
1417
  case "ThrottlingException":
1835
1418
  case "com.amazonaws.signer#ThrottlingException":
1836
- response = {
1837
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1838
- name: errorCode,
1839
- $metadata: deserializeMetadata(output),
1840
- };
1841
- break;
1419
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1842
1420
  case "TooManyRequestsException":
1843
1421
  case "com.amazonaws.signer#TooManyRequestsException":
1844
- response = {
1845
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1846
- name: errorCode,
1847
- $metadata: deserializeMetadata(output),
1848
- };
1849
- break;
1422
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1850
1423
  case "ValidationException":
1851
1424
  case "com.amazonaws.signer#ValidationException":
1852
- response = {
1853
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1854
- name: errorCode,
1855
- $metadata: deserializeMetadata(output),
1856
- };
1857
- break;
1425
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1858
1426
  default:
1859
1427
  const parsedBody = parsedOutput.body;
1860
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1861
- response = {
1862
- ...parsedBody,
1863
- name: `${errorCode}`,
1864
- message: parsedBody.message || parsedBody.Message || errorCode,
1428
+ response = new SignerServiceException_1.SignerServiceException({
1429
+ name: parsedBody.code || parsedBody.Code || errorCode,
1865
1430
  $fault: "client",
1866
1431
  $metadata: deserializeMetadata(output),
1867
- };
1432
+ });
1433
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1868
1434
  }
1869
- const message = response.message || response.Message || errorCode;
1870
- response.message = message;
1871
- delete response.Message;
1872
- return Promise.reject(Object.assign(new Error(message), response));
1873
1435
  };
1874
1436
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1875
1437
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1893,51 +1455,25 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1893
1455
  switch (errorCode) {
1894
1456
  case "BadRequestException":
1895
1457
  case "com.amazonaws.signer#BadRequestException":
1896
- response = {
1897
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1898
- name: errorCode,
1899
- $metadata: deserializeMetadata(output),
1900
- };
1901
- break;
1458
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1902
1459
  case "InternalServiceErrorException":
1903
1460
  case "com.amazonaws.signer#InternalServiceErrorException":
1904
- response = {
1905
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1906
- name: errorCode,
1907
- $metadata: deserializeMetadata(output),
1908
- };
1909
- break;
1461
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1910
1462
  case "NotFoundException":
1911
1463
  case "com.amazonaws.signer#NotFoundException":
1912
- response = {
1913
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1914
- name: errorCode,
1915
- $metadata: deserializeMetadata(output),
1916
- };
1917
- break;
1464
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1918
1465
  case "TooManyRequestsException":
1919
1466
  case "com.amazonaws.signer#TooManyRequestsException":
1920
- response = {
1921
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1922
- name: errorCode,
1923
- $metadata: deserializeMetadata(output),
1924
- };
1925
- break;
1467
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1926
1468
  default:
1927
1469
  const parsedBody = parsedOutput.body;
1928
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1929
- response = {
1930
- ...parsedBody,
1931
- name: `${errorCode}`,
1932
- message: parsedBody.message || parsedBody.Message || errorCode,
1470
+ response = new SignerServiceException_1.SignerServiceException({
1471
+ name: parsedBody.code || parsedBody.Code || errorCode,
1933
1472
  $fault: "client",
1934
1473
  $metadata: deserializeMetadata(output),
1935
- };
1474
+ });
1475
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1936
1476
  }
1937
- const message = response.message || response.Message || errorCode;
1938
- response.message = message;
1939
- delete response.Message;
1940
- return Promise.reject(Object.assign(new Error(message), response));
1941
1477
  };
1942
1478
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1943
1479
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1961,60 +1497,28 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1961
1497
  switch (errorCode) {
1962
1498
  case "BadRequestException":
1963
1499
  case "com.amazonaws.signer#BadRequestException":
1964
- response = {
1965
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1966
- name: errorCode,
1967
- $metadata: deserializeMetadata(output),
1968
- };
1969
- break;
1500
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1970
1501
  case "InternalServiceErrorException":
1971
1502
  case "com.amazonaws.signer#InternalServiceErrorException":
1972
- response = {
1973
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1974
- name: errorCode,
1975
- $metadata: deserializeMetadata(output),
1976
- };
1977
- break;
1503
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1978
1504
  case "NotFoundException":
1979
1505
  case "com.amazonaws.signer#NotFoundException":
1980
- response = {
1981
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1982
- name: errorCode,
1983
- $metadata: deserializeMetadata(output),
1984
- };
1985
- break;
1506
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1986
1507
  case "TooManyRequestsException":
1987
1508
  case "com.amazonaws.signer#TooManyRequestsException":
1988
- response = {
1989
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1990
- name: errorCode,
1991
- $metadata: deserializeMetadata(output),
1992
- };
1993
- break;
1509
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1994
1510
  default:
1995
1511
  const parsedBody = parsedOutput.body;
1996
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1997
- response = {
1998
- ...parsedBody,
1999
- name: `${errorCode}`,
2000
- message: parsedBody.message || parsedBody.Message || errorCode,
1512
+ response = new SignerServiceException_1.SignerServiceException({
1513
+ name: parsedBody.code || parsedBody.Code || errorCode,
2001
1514
  $fault: "client",
2002
1515
  $metadata: deserializeMetadata(output),
2003
- };
1516
+ });
1517
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2004
1518
  }
2005
- const message = response.message || response.Message || errorCode;
2006
- response.message = message;
2007
- delete response.Message;
2008
- return Promise.reject(Object.assign(new Error(message), response));
2009
1519
  };
2010
1520
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2011
- const contents = {
2012
- name: "AccessDeniedException",
2013
- $fault: "client",
2014
- $metadata: deserializeMetadata(parsedOutput),
2015
- code: undefined,
2016
- message: undefined,
2017
- };
1521
+ const contents = {};
2018
1522
  const data = parsedOutput.body;
2019
1523
  if (data.code !== undefined && data.code !== null) {
2020
1524
  contents.code = smithy_client_1.expectString(data.code);
@@ -2022,16 +1526,14 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
2022
1526
  if (data.message !== undefined && data.message !== null) {
2023
1527
  contents.message = smithy_client_1.expectString(data.message);
2024
1528
  }
2025
- return contents;
1529
+ const exception = new models_0_1.AccessDeniedException({
1530
+ $metadata: deserializeMetadata(parsedOutput),
1531
+ ...contents,
1532
+ });
1533
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2026
1534
  };
2027
1535
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
2028
- const contents = {
2029
- name: "BadRequestException",
2030
- $fault: "client",
2031
- $metadata: deserializeMetadata(parsedOutput),
2032
- code: undefined,
2033
- message: undefined,
2034
- };
1536
+ const contents = {};
2035
1537
  const data = parsedOutput.body;
2036
1538
  if (data.code !== undefined && data.code !== null) {
2037
1539
  contents.code = smithy_client_1.expectString(data.code);
@@ -2039,16 +1541,14 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
2039
1541
  if (data.message !== undefined && data.message !== null) {
2040
1542
  contents.message = smithy_client_1.expectString(data.message);
2041
1543
  }
2042
- return contents;
1544
+ const exception = new models_0_1.BadRequestException({
1545
+ $metadata: deserializeMetadata(parsedOutput),
1546
+ ...contents,
1547
+ });
1548
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2043
1549
  };
2044
1550
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2045
- const contents = {
2046
- name: "ConflictException",
2047
- $fault: "client",
2048
- $metadata: deserializeMetadata(parsedOutput),
2049
- code: undefined,
2050
- message: undefined,
2051
- };
1551
+ const contents = {};
2052
1552
  const data = parsedOutput.body;
2053
1553
  if (data.code !== undefined && data.code !== null) {
2054
1554
  contents.code = smithy_client_1.expectString(data.code);
@@ -2056,16 +1556,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2056
1556
  if (data.message !== undefined && data.message !== null) {
2057
1557
  contents.message = smithy_client_1.expectString(data.message);
2058
1558
  }
2059
- return contents;
1559
+ const exception = new models_0_1.ConflictException({
1560
+ $metadata: deserializeMetadata(parsedOutput),
1561
+ ...contents,
1562
+ });
1563
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2060
1564
  };
2061
1565
  const deserializeAws_restJson1InternalServiceErrorExceptionResponse = async (parsedOutput, context) => {
2062
- const contents = {
2063
- name: "InternalServiceErrorException",
2064
- $fault: "server",
2065
- $metadata: deserializeMetadata(parsedOutput),
2066
- code: undefined,
2067
- message: undefined,
2068
- };
1566
+ const contents = {};
2069
1567
  const data = parsedOutput.body;
2070
1568
  if (data.code !== undefined && data.code !== null) {
2071
1569
  contents.code = smithy_client_1.expectString(data.code);
@@ -2073,16 +1571,14 @@ const deserializeAws_restJson1InternalServiceErrorExceptionResponse = async (par
2073
1571
  if (data.message !== undefined && data.message !== null) {
2074
1572
  contents.message = smithy_client_1.expectString(data.message);
2075
1573
  }
2076
- return contents;
1574
+ const exception = new models_0_1.InternalServiceErrorException({
1575
+ $metadata: deserializeMetadata(parsedOutput),
1576
+ ...contents,
1577
+ });
1578
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2077
1579
  };
2078
1580
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
2079
- const contents = {
2080
- name: "NotFoundException",
2081
- $fault: "client",
2082
- $metadata: deserializeMetadata(parsedOutput),
2083
- code: undefined,
2084
- message: undefined,
2085
- };
1581
+ const contents = {};
2086
1582
  const data = parsedOutput.body;
2087
1583
  if (data.code !== undefined && data.code !== null) {
2088
1584
  contents.code = smithy_client_1.expectString(data.code);
@@ -2090,16 +1586,14 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
2090
1586
  if (data.message !== undefined && data.message !== null) {
2091
1587
  contents.message = smithy_client_1.expectString(data.message);
2092
1588
  }
2093
- return contents;
1589
+ const exception = new models_0_1.NotFoundException({
1590
+ $metadata: deserializeMetadata(parsedOutput),
1591
+ ...contents,
1592
+ });
1593
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2094
1594
  };
2095
1595
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2096
- const contents = {
2097
- name: "ResourceNotFoundException",
2098
- $fault: "client",
2099
- $metadata: deserializeMetadata(parsedOutput),
2100
- code: undefined,
2101
- message: undefined,
2102
- };
1596
+ const contents = {};
2103
1597
  const data = parsedOutput.body;
2104
1598
  if (data.code !== undefined && data.code !== null) {
2105
1599
  contents.code = smithy_client_1.expectString(data.code);
@@ -2107,16 +1601,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2107
1601
  if (data.message !== undefined && data.message !== null) {
2108
1602
  contents.message = smithy_client_1.expectString(data.message);
2109
1603
  }
2110
- return contents;
1604
+ const exception = new models_0_1.ResourceNotFoundException({
1605
+ $metadata: deserializeMetadata(parsedOutput),
1606
+ ...contents,
1607
+ });
1608
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2111
1609
  };
2112
1610
  const deserializeAws_restJson1ServiceLimitExceededExceptionResponse = async (parsedOutput, context) => {
2113
- const contents = {
2114
- name: "ServiceLimitExceededException",
2115
- $fault: "client",
2116
- $metadata: deserializeMetadata(parsedOutput),
2117
- code: undefined,
2118
- message: undefined,
2119
- };
1611
+ const contents = {};
2120
1612
  const data = parsedOutput.body;
2121
1613
  if (data.code !== undefined && data.code !== null) {
2122
1614
  contents.code = smithy_client_1.expectString(data.code);
@@ -2124,16 +1616,14 @@ const deserializeAws_restJson1ServiceLimitExceededExceptionResponse = async (par
2124
1616
  if (data.message !== undefined && data.message !== null) {
2125
1617
  contents.message = smithy_client_1.expectString(data.message);
2126
1618
  }
2127
- return contents;
1619
+ const exception = new models_0_1.ServiceLimitExceededException({
1620
+ $metadata: deserializeMetadata(parsedOutput),
1621
+ ...contents,
1622
+ });
1623
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2128
1624
  };
2129
1625
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2130
- const contents = {
2131
- name: "ThrottlingException",
2132
- $fault: "client",
2133
- $metadata: deserializeMetadata(parsedOutput),
2134
- code: undefined,
2135
- message: undefined,
2136
- };
1626
+ const contents = {};
2137
1627
  const data = parsedOutput.body;
2138
1628
  if (data.code !== undefined && data.code !== null) {
2139
1629
  contents.code = smithy_client_1.expectString(data.code);
@@ -2141,16 +1631,14 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2141
1631
  if (data.message !== undefined && data.message !== null) {
2142
1632
  contents.message = smithy_client_1.expectString(data.message);
2143
1633
  }
2144
- return contents;
1634
+ const exception = new models_0_1.ThrottlingException({
1635
+ $metadata: deserializeMetadata(parsedOutput),
1636
+ ...contents,
1637
+ });
1638
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2145
1639
  };
2146
1640
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
2147
- const contents = {
2148
- name: "TooManyRequestsException",
2149
- $fault: "client",
2150
- $metadata: deserializeMetadata(parsedOutput),
2151
- code: undefined,
2152
- message: undefined,
2153
- };
1641
+ const contents = {};
2154
1642
  const data = parsedOutput.body;
2155
1643
  if (data.code !== undefined && data.code !== null) {
2156
1644
  contents.code = smithy_client_1.expectString(data.code);
@@ -2158,16 +1646,14 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
2158
1646
  if (data.message !== undefined && data.message !== null) {
2159
1647
  contents.message = smithy_client_1.expectString(data.message);
2160
1648
  }
2161
- return contents;
1649
+ const exception = new models_0_1.TooManyRequestsException({
1650
+ $metadata: deserializeMetadata(parsedOutput),
1651
+ ...contents,
1652
+ });
1653
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2162
1654
  };
2163
1655
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
2164
- const contents = {
2165
- name: "ValidationException",
2166
- $fault: "client",
2167
- $metadata: deserializeMetadata(parsedOutput),
2168
- code: undefined,
2169
- message: undefined,
2170
- };
1656
+ const contents = {};
2171
1657
  const data = parsedOutput.body;
2172
1658
  if (data.code !== undefined && data.code !== null) {
2173
1659
  contents.code = smithy_client_1.expectString(data.code);
@@ -2175,7 +1661,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
2175
1661
  if (data.message !== undefined && data.message !== null) {
2176
1662
  contents.message = smithy_client_1.expectString(data.message);
2177
1663
  }
2178
- return contents;
1664
+ const exception = new models_0_1.ValidationException({
1665
+ $metadata: deserializeMetadata(parsedOutput),
1666
+ ...contents,
1667
+ });
1668
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2179
1669
  };
2180
1670
  const serializeAws_restJson1Destination = (input, context) => {
2181
1671
  return {
@@ -2260,7 +1750,7 @@ const deserializeAws_restJson1EncryptionAlgorithmOptions = (output, context) =>
2260
1750
  };
2261
1751
  };
2262
1752
  const deserializeAws_restJson1EncryptionAlgorithms = (output, context) => {
2263
- return (output || [])
1753
+ const retVal = (output || [])
2264
1754
  .filter((e) => e != null)
2265
1755
  .map((entry) => {
2266
1756
  if (entry === null) {
@@ -2268,6 +1758,7 @@ const deserializeAws_restJson1EncryptionAlgorithms = (output, context) => {
2268
1758
  }
2269
1759
  return smithy_client_1.expectString(entry);
2270
1760
  });
1761
+ return retVal;
2271
1762
  };
2272
1763
  const deserializeAws_restJson1HashAlgorithmOptions = (output, context) => {
2273
1764
  return {
@@ -2278,7 +1769,7 @@ const deserializeAws_restJson1HashAlgorithmOptions = (output, context) => {
2278
1769
  };
2279
1770
  };
2280
1771
  const deserializeAws_restJson1HashAlgorithms = (output, context) => {
2281
- return (output || [])
1772
+ const retVal = (output || [])
2282
1773
  .filter((e) => e != null)
2283
1774
  .map((entry) => {
2284
1775
  if (entry === null) {
@@ -2286,9 +1777,10 @@ const deserializeAws_restJson1HashAlgorithms = (output, context) => {
2286
1777
  }
2287
1778
  return smithy_client_1.expectString(entry);
2288
1779
  });
1780
+ return retVal;
2289
1781
  };
2290
1782
  const deserializeAws_restJson1ImageFormats = (output, context) => {
2291
- return (output || [])
1783
+ const retVal = (output || [])
2292
1784
  .filter((e) => e != null)
2293
1785
  .map((entry) => {
2294
1786
  if (entry === null) {
@@ -2296,6 +1788,7 @@ const deserializeAws_restJson1ImageFormats = (output, context) => {
2296
1788
  }
2297
1789
  return smithy_client_1.expectString(entry);
2298
1790
  });
1791
+ return retVal;
2299
1792
  };
2300
1793
  const deserializeAws_restJson1Permission = (output, context) => {
2301
1794
  return {
@@ -2306,7 +1799,7 @@ const deserializeAws_restJson1Permission = (output, context) => {
2306
1799
  };
2307
1800
  };
2308
1801
  const deserializeAws_restJson1Permissions = (output, context) => {
2309
- return (output || [])
1802
+ const retVal = (output || [])
2310
1803
  .filter((e) => e != null)
2311
1804
  .map((entry) => {
2312
1805
  if (entry === null) {
@@ -2314,6 +1807,7 @@ const deserializeAws_restJson1Permissions = (output, context) => {
2314
1807
  }
2315
1808
  return deserializeAws_restJson1Permission(entry, context);
2316
1809
  });
1810
+ return retVal;
2317
1811
  };
2318
1812
  const deserializeAws_restJson1S3SignedObject = (output, context) => {
2319
1813
  return {
@@ -2403,7 +1897,7 @@ const deserializeAws_restJson1SigningJobRevocationRecord = (output, context) =>
2403
1897
  };
2404
1898
  };
2405
1899
  const deserializeAws_restJson1SigningJobs = (output, context) => {
2406
- return (output || [])
1900
+ const retVal = (output || [])
2407
1901
  .filter((e) => e != null)
2408
1902
  .map((entry) => {
2409
1903
  if (entry === null) {
@@ -2411,6 +1905,7 @@ const deserializeAws_restJson1SigningJobs = (output, context) => {
2411
1905
  }
2412
1906
  return deserializeAws_restJson1SigningJob(entry, context);
2413
1907
  });
1908
+ return retVal;
2414
1909
  };
2415
1910
  const deserializeAws_restJson1SigningMaterial = (output, context) => {
2416
1911
  return {
@@ -2454,7 +1949,7 @@ const deserializeAws_restJson1SigningPlatformOverrides = (output, context) => {
2454
1949
  };
2455
1950
  };
2456
1951
  const deserializeAws_restJson1SigningPlatforms = (output, context) => {
2457
- return (output || [])
1952
+ const retVal = (output || [])
2458
1953
  .filter((e) => e != null)
2459
1954
  .map((entry) => {
2460
1955
  if (entry === null) {
@@ -2462,6 +1957,7 @@ const deserializeAws_restJson1SigningPlatforms = (output, context) => {
2462
1957
  }
2463
1958
  return deserializeAws_restJson1SigningPlatform(entry, context);
2464
1959
  });
1960
+ return retVal;
2465
1961
  };
2466
1962
  const deserializeAws_restJson1SigningProfile = (output, context) => {
2467
1963
  return {
@@ -2498,7 +1994,7 @@ const deserializeAws_restJson1SigningProfileRevocationRecord = (output, context)
2498
1994
  };
2499
1995
  };
2500
1996
  const deserializeAws_restJson1SigningProfiles = (output, context) => {
2501
- return (output || [])
1997
+ const retVal = (output || [])
2502
1998
  .filter((e) => e != null)
2503
1999
  .map((entry) => {
2504
2000
  if (entry === null) {
@@ -2506,6 +2002,7 @@ const deserializeAws_restJson1SigningProfiles = (output, context) => {
2506
2002
  }
2507
2003
  return deserializeAws_restJson1SigningProfile(entry, context);
2508
2004
  });
2005
+ return retVal;
2509
2006
  };
2510
2007
  const deserializeAws_restJson1Source = (output, context) => {
2511
2008
  return {