@aws-sdk/client-kms 3.118.1 → 3.128.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -526,8 +526,7 @@ const deserializeAws_json1_1CancelKeyDeletionCommandError = async (output, conte
526
526
  body: await parseBody(output.body, context),
527
527
  };
528
528
  let response;
529
- let errorCode = "UnknownError";
530
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
529
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
531
530
  switch (errorCode) {
532
531
  case "DependencyTimeoutException":
533
532
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -546,10 +545,12 @@ const deserializeAws_json1_1CancelKeyDeletionCommandError = async (output, conte
546
545
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
547
546
  default:
548
547
  const parsedBody = parsedOutput.body;
548
+ const $metadata = deserializeMetadata(output);
549
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
549
550
  response = new KMSServiceException_1.KMSServiceException({
550
- name: parsedBody.code || parsedBody.Code || errorCode,
551
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
551
552
  $fault: "client",
552
- $metadata: deserializeMetadata(output),
553
+ $metadata,
553
554
  });
554
555
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
555
556
  }
@@ -574,8 +575,7 @@ const deserializeAws_json1_1ConnectCustomKeyStoreCommandError = async (output, c
574
575
  body: await parseBody(output.body, context),
575
576
  };
576
577
  let response;
577
- let errorCode = "UnknownError";
578
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
578
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
579
579
  switch (errorCode) {
580
580
  case "CloudHsmClusterInvalidConfigurationException":
581
581
  case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException":
@@ -594,10 +594,12 @@ const deserializeAws_json1_1ConnectCustomKeyStoreCommandError = async (output, c
594
594
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
595
595
  default:
596
596
  const parsedBody = parsedOutput.body;
597
+ const $metadata = deserializeMetadata(output);
598
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
597
599
  response = new KMSServiceException_1.KMSServiceException({
598
- name: parsedBody.code || parsedBody.Code || errorCode,
600
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
599
601
  $fault: "client",
600
- $metadata: deserializeMetadata(output),
602
+ $metadata,
601
603
  });
602
604
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
603
605
  }
@@ -619,8 +621,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async (output, context) =>
619
621
  body: await parseBody(output.body, context),
620
622
  };
621
623
  let response;
622
- let errorCode = "UnknownError";
623
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
624
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
624
625
  switch (errorCode) {
625
626
  case "AlreadyExistsException":
626
627
  case "com.amazonaws.kms#AlreadyExistsException":
@@ -645,10 +646,12 @@ const deserializeAws_json1_1CreateAliasCommandError = async (output, context) =>
645
646
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
646
647
  default:
647
648
  const parsedBody = parsedOutput.body;
649
+ const $metadata = deserializeMetadata(output);
650
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
648
651
  response = new KMSServiceException_1.KMSServiceException({
649
- name: parsedBody.code || parsedBody.Code || errorCode,
652
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
650
653
  $fault: "client",
651
- $metadata: deserializeMetadata(output),
654
+ $metadata,
652
655
  });
653
656
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
654
657
  }
@@ -673,8 +676,7 @@ const deserializeAws_json1_1CreateCustomKeyStoreCommandError = async (output, co
673
676
  body: await parseBody(output.body, context),
674
677
  };
675
678
  let response;
676
- let errorCode = "UnknownError";
677
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
679
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
678
680
  switch (errorCode) {
679
681
  case "CloudHsmClusterInUseException":
680
682
  case "com.amazonaws.kms#CloudHsmClusterInUseException":
@@ -699,10 +701,12 @@ const deserializeAws_json1_1CreateCustomKeyStoreCommandError = async (output, co
699
701
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
700
702
  default:
701
703
  const parsedBody = parsedOutput.body;
704
+ const $metadata = deserializeMetadata(output);
705
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
702
706
  response = new KMSServiceException_1.KMSServiceException({
703
- name: parsedBody.code || parsedBody.Code || errorCode,
707
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
704
708
  $fault: "client",
705
- $metadata: deserializeMetadata(output),
709
+ $metadata,
706
710
  });
707
711
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
708
712
  }
@@ -727,8 +731,7 @@ const deserializeAws_json1_1CreateGrantCommandError = async (output, context) =>
727
731
  body: await parseBody(output.body, context),
728
732
  };
729
733
  let response;
730
- let errorCode = "UnknownError";
731
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
734
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
732
735
  switch (errorCode) {
733
736
  case "DependencyTimeoutException":
734
737
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -756,10 +759,12 @@ const deserializeAws_json1_1CreateGrantCommandError = async (output, context) =>
756
759
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
757
760
  default:
758
761
  const parsedBody = parsedOutput.body;
762
+ const $metadata = deserializeMetadata(output);
763
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
759
764
  response = new KMSServiceException_1.KMSServiceException({
760
- name: parsedBody.code || parsedBody.Code || errorCode,
765
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
761
766
  $fault: "client",
762
- $metadata: deserializeMetadata(output),
767
+ $metadata,
763
768
  });
764
769
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
765
770
  }
@@ -784,8 +789,7 @@ const deserializeAws_json1_1CreateKeyCommandError = async (output, context) => {
784
789
  body: await parseBody(output.body, context),
785
790
  };
786
791
  let response;
787
- let errorCode = "UnknownError";
788
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
793
  switch (errorCode) {
790
794
  case "CloudHsmClusterInvalidConfigurationException":
791
795
  case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException":
@@ -819,10 +823,12 @@ const deserializeAws_json1_1CreateKeyCommandError = async (output, context) => {
819
823
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
820
824
  default:
821
825
  const parsedBody = parsedOutput.body;
826
+ const $metadata = deserializeMetadata(output);
827
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
822
828
  response = new KMSServiceException_1.KMSServiceException({
823
- name: parsedBody.code || parsedBody.Code || errorCode,
829
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
824
830
  $fault: "client",
825
- $metadata: deserializeMetadata(output),
831
+ $metadata,
826
832
  });
827
833
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
828
834
  }
@@ -847,8 +853,7 @@ const deserializeAws_json1_1DecryptCommandError = async (output, context) => {
847
853
  body: await parseBody(output.body, context),
848
854
  };
849
855
  let response;
850
- let errorCode = "UnknownError";
851
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
856
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
852
857
  switch (errorCode) {
853
858
  case "DependencyTimeoutException":
854
859
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -882,10 +887,12 @@ const deserializeAws_json1_1DecryptCommandError = async (output, context) => {
882
887
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
883
888
  default:
884
889
  const parsedBody = parsedOutput.body;
890
+ const $metadata = deserializeMetadata(output);
891
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
885
892
  response = new KMSServiceException_1.KMSServiceException({
886
- name: parsedBody.code || parsedBody.Code || errorCode,
893
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
887
894
  $fault: "client",
888
- $metadata: deserializeMetadata(output),
895
+ $metadata,
889
896
  });
890
897
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
891
898
  }
@@ -907,8 +914,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async (output, context) =>
907
914
  body: await parseBody(output.body, context),
908
915
  };
909
916
  let response;
910
- let errorCode = "UnknownError";
911
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
917
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
912
918
  switch (errorCode) {
913
919
  case "DependencyTimeoutException":
914
920
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -924,10 +930,12 @@ const deserializeAws_json1_1DeleteAliasCommandError = async (output, context) =>
924
930
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
925
931
  default:
926
932
  const parsedBody = parsedOutput.body;
933
+ const $metadata = deserializeMetadata(output);
934
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
927
935
  response = new KMSServiceException_1.KMSServiceException({
928
- name: parsedBody.code || parsedBody.Code || errorCode,
936
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
929
937
  $fault: "client",
930
- $metadata: deserializeMetadata(output),
938
+ $metadata,
931
939
  });
932
940
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
933
941
  }
@@ -952,8 +960,7 @@ const deserializeAws_json1_1DeleteCustomKeyStoreCommandError = async (output, co
952
960
  body: await parseBody(output.body, context),
953
961
  };
954
962
  let response;
955
- let errorCode = "UnknownError";
956
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
963
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
957
964
  switch (errorCode) {
958
965
  case "CustomKeyStoreHasCMKsException":
959
966
  case "com.amazonaws.kms#CustomKeyStoreHasCMKsException":
@@ -969,10 +976,12 @@ const deserializeAws_json1_1DeleteCustomKeyStoreCommandError = async (output, co
969
976
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
970
977
  default:
971
978
  const parsedBody = parsedOutput.body;
979
+ const $metadata = deserializeMetadata(output);
980
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
972
981
  response = new KMSServiceException_1.KMSServiceException({
973
- name: parsedBody.code || parsedBody.Code || errorCode,
982
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
974
983
  $fault: "client",
975
- $metadata: deserializeMetadata(output),
984
+ $metadata,
976
985
  });
977
986
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
978
987
  }
@@ -994,8 +1003,7 @@ const deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = async (outpu
994
1003
  body: await parseBody(output.body, context),
995
1004
  };
996
1005
  let response;
997
- let errorCode = "UnknownError";
998
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1006
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
999
1007
  switch (errorCode) {
1000
1008
  case "DependencyTimeoutException":
1001
1009
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1017,10 +1025,12 @@ const deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = async (outpu
1017
1025
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1018
1026
  default:
1019
1027
  const parsedBody = parsedOutput.body;
1028
+ const $metadata = deserializeMetadata(output);
1029
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1020
1030
  response = new KMSServiceException_1.KMSServiceException({
1021
- name: parsedBody.code || parsedBody.Code || errorCode,
1031
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1022
1032
  $fault: "client",
1023
- $metadata: deserializeMetadata(output),
1033
+ $metadata,
1024
1034
  });
1025
1035
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1026
1036
  }
@@ -1045,8 +1055,7 @@ const deserializeAws_json1_1DescribeCustomKeyStoresCommandError = async (output,
1045
1055
  body: await parseBody(output.body, context),
1046
1056
  };
1047
1057
  let response;
1048
- let errorCode = "UnknownError";
1049
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1050
1059
  switch (errorCode) {
1051
1060
  case "CustomKeyStoreNotFoundException":
1052
1061
  case "com.amazonaws.kms#CustomKeyStoreNotFoundException":
@@ -1059,10 +1068,12 @@ const deserializeAws_json1_1DescribeCustomKeyStoresCommandError = async (output,
1059
1068
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
1060
1069
  default:
1061
1070
  const parsedBody = parsedOutput.body;
1071
+ const $metadata = deserializeMetadata(output);
1072
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1062
1073
  response = new KMSServiceException_1.KMSServiceException({
1063
- name: parsedBody.code || parsedBody.Code || errorCode,
1074
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1064
1075
  $fault: "client",
1065
- $metadata: deserializeMetadata(output),
1076
+ $metadata,
1066
1077
  });
1067
1078
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1068
1079
  }
@@ -1087,8 +1098,7 @@ const deserializeAws_json1_1DescribeKeyCommandError = async (output, context) =>
1087
1098
  body: await parseBody(output.body, context),
1088
1099
  };
1089
1100
  let response;
1090
- let errorCode = "UnknownError";
1091
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1101
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1092
1102
  switch (errorCode) {
1093
1103
  case "DependencyTimeoutException":
1094
1104
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1104,10 +1114,12 @@ const deserializeAws_json1_1DescribeKeyCommandError = async (output, context) =>
1104
1114
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1105
1115
  default:
1106
1116
  const parsedBody = parsedOutput.body;
1117
+ const $metadata = deserializeMetadata(output);
1118
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1107
1119
  response = new KMSServiceException_1.KMSServiceException({
1108
- name: parsedBody.code || parsedBody.Code || errorCode,
1120
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1109
1121
  $fault: "client",
1110
- $metadata: deserializeMetadata(output),
1122
+ $metadata,
1111
1123
  });
1112
1124
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1113
1125
  }
@@ -1129,8 +1141,7 @@ const deserializeAws_json1_1DisableKeyCommandError = async (output, context) =>
1129
1141
  body: await parseBody(output.body, context),
1130
1142
  };
1131
1143
  let response;
1132
- let errorCode = "UnknownError";
1133
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1144
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1134
1145
  switch (errorCode) {
1135
1146
  case "DependencyTimeoutException":
1136
1147
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1149,10 +1160,12 @@ const deserializeAws_json1_1DisableKeyCommandError = async (output, context) =>
1149
1160
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1150
1161
  default:
1151
1162
  const parsedBody = parsedOutput.body;
1163
+ const $metadata = deserializeMetadata(output);
1164
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1152
1165
  response = new KMSServiceException_1.KMSServiceException({
1153
- name: parsedBody.code || parsedBody.Code || errorCode,
1166
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1154
1167
  $fault: "client",
1155
- $metadata: deserializeMetadata(output),
1168
+ $metadata,
1156
1169
  });
1157
1170
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1158
1171
  }
@@ -1174,8 +1187,7 @@ const deserializeAws_json1_1DisableKeyRotationCommandError = async (output, cont
1174
1187
  body: await parseBody(output.body, context),
1175
1188
  };
1176
1189
  let response;
1177
- let errorCode = "UnknownError";
1178
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1190
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
1191
  switch (errorCode) {
1180
1192
  case "DependencyTimeoutException":
1181
1193
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1200,10 +1212,12 @@ const deserializeAws_json1_1DisableKeyRotationCommandError = async (output, cont
1200
1212
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1201
1213
  default:
1202
1214
  const parsedBody = parsedOutput.body;
1215
+ const $metadata = deserializeMetadata(output);
1216
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1203
1217
  response = new KMSServiceException_1.KMSServiceException({
1204
- name: parsedBody.code || parsedBody.Code || errorCode,
1218
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1205
1219
  $fault: "client",
1206
- $metadata: deserializeMetadata(output),
1220
+ $metadata,
1207
1221
  });
1208
1222
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1209
1223
  }
@@ -1228,8 +1242,7 @@ const deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = async (output
1228
1242
  body: await parseBody(output.body, context),
1229
1243
  };
1230
1244
  let response;
1231
- let errorCode = "UnknownError";
1232
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1245
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1233
1246
  switch (errorCode) {
1234
1247
  case "CustomKeyStoreInvalidStateException":
1235
1248
  case "com.amazonaws.kms#CustomKeyStoreInvalidStateException":
@@ -1242,10 +1255,12 @@ const deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = async (output
1242
1255
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
1243
1256
  default:
1244
1257
  const parsedBody = parsedOutput.body;
1258
+ const $metadata = deserializeMetadata(output);
1259
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1245
1260
  response = new KMSServiceException_1.KMSServiceException({
1246
- name: parsedBody.code || parsedBody.Code || errorCode,
1261
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1247
1262
  $fault: "client",
1248
- $metadata: deserializeMetadata(output),
1263
+ $metadata,
1249
1264
  });
1250
1265
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1251
1266
  }
@@ -1267,8 +1282,7 @@ const deserializeAws_json1_1EnableKeyCommandError = async (output, context) => {
1267
1282
  body: await parseBody(output.body, context),
1268
1283
  };
1269
1284
  let response;
1270
- let errorCode = "UnknownError";
1271
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1285
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1272
1286
  switch (errorCode) {
1273
1287
  case "DependencyTimeoutException":
1274
1288
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1290,10 +1304,12 @@ const deserializeAws_json1_1EnableKeyCommandError = async (output, context) => {
1290
1304
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1291
1305
  default:
1292
1306
  const parsedBody = parsedOutput.body;
1307
+ const $metadata = deserializeMetadata(output);
1308
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1293
1309
  response = new KMSServiceException_1.KMSServiceException({
1294
- name: parsedBody.code || parsedBody.Code || errorCode,
1310
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1295
1311
  $fault: "client",
1296
- $metadata: deserializeMetadata(output),
1312
+ $metadata,
1297
1313
  });
1298
1314
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1299
1315
  }
@@ -1315,8 +1331,7 @@ const deserializeAws_json1_1EnableKeyRotationCommandError = async (output, conte
1315
1331
  body: await parseBody(output.body, context),
1316
1332
  };
1317
1333
  let response;
1318
- let errorCode = "UnknownError";
1319
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1334
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1320
1335
  switch (errorCode) {
1321
1336
  case "DependencyTimeoutException":
1322
1337
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1341,10 +1356,12 @@ const deserializeAws_json1_1EnableKeyRotationCommandError = async (output, conte
1341
1356
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1342
1357
  default:
1343
1358
  const parsedBody = parsedOutput.body;
1359
+ const $metadata = deserializeMetadata(output);
1360
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1344
1361
  response = new KMSServiceException_1.KMSServiceException({
1345
- name: parsedBody.code || parsedBody.Code || errorCode,
1362
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1346
1363
  $fault: "client",
1347
- $metadata: deserializeMetadata(output),
1364
+ $metadata,
1348
1365
  });
1349
1366
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1350
1367
  }
@@ -1369,8 +1386,7 @@ const deserializeAws_json1_1EncryptCommandError = async (output, context) => {
1369
1386
  body: await parseBody(output.body, context),
1370
1387
  };
1371
1388
  let response;
1372
- let errorCode = "UnknownError";
1373
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1389
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1374
1390
  switch (errorCode) {
1375
1391
  case "DependencyTimeoutException":
1376
1392
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1398,10 +1414,12 @@ const deserializeAws_json1_1EncryptCommandError = async (output, context) => {
1398
1414
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1399
1415
  default:
1400
1416
  const parsedBody = parsedOutput.body;
1417
+ const $metadata = deserializeMetadata(output);
1418
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1401
1419
  response = new KMSServiceException_1.KMSServiceException({
1402
- name: parsedBody.code || parsedBody.Code || errorCode,
1420
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1403
1421
  $fault: "client",
1404
- $metadata: deserializeMetadata(output),
1422
+ $metadata,
1405
1423
  });
1406
1424
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1407
1425
  }
@@ -1426,8 +1444,7 @@ const deserializeAws_json1_1GenerateDataKeyCommandError = async (output, context
1426
1444
  body: await parseBody(output.body, context),
1427
1445
  };
1428
1446
  let response;
1429
- let errorCode = "UnknownError";
1430
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1447
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1431
1448
  switch (errorCode) {
1432
1449
  case "DependencyTimeoutException":
1433
1450
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1455,10 +1472,12 @@ const deserializeAws_json1_1GenerateDataKeyCommandError = async (output, context
1455
1472
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1456
1473
  default:
1457
1474
  const parsedBody = parsedOutput.body;
1475
+ const $metadata = deserializeMetadata(output);
1476
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1458
1477
  response = new KMSServiceException_1.KMSServiceException({
1459
- name: parsedBody.code || parsedBody.Code || errorCode,
1478
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1460
1479
  $fault: "client",
1461
- $metadata: deserializeMetadata(output),
1480
+ $metadata,
1462
1481
  });
1463
1482
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1464
1483
  }
@@ -1483,8 +1502,7 @@ const deserializeAws_json1_1GenerateDataKeyPairCommandError = async (output, con
1483
1502
  body: await parseBody(output.body, context),
1484
1503
  };
1485
1504
  let response;
1486
- let errorCode = "UnknownError";
1487
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1505
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1488
1506
  switch (errorCode) {
1489
1507
  case "DependencyTimeoutException":
1490
1508
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1515,10 +1533,12 @@ const deserializeAws_json1_1GenerateDataKeyPairCommandError = async (output, con
1515
1533
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1516
1534
  default:
1517
1535
  const parsedBody = parsedOutput.body;
1536
+ const $metadata = deserializeMetadata(output);
1537
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1518
1538
  response = new KMSServiceException_1.KMSServiceException({
1519
- name: parsedBody.code || parsedBody.Code || errorCode,
1539
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1520
1540
  $fault: "client",
1521
- $metadata: deserializeMetadata(output),
1541
+ $metadata,
1522
1542
  });
1523
1543
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1524
1544
  }
@@ -1543,8 +1563,7 @@ const deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = as
1543
1563
  body: await parseBody(output.body, context),
1544
1564
  };
1545
1565
  let response;
1546
- let errorCode = "UnknownError";
1547
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1566
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1548
1567
  switch (errorCode) {
1549
1568
  case "DependencyTimeoutException":
1550
1569
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1575,10 +1594,12 @@ const deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = as
1575
1594
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1576
1595
  default:
1577
1596
  const parsedBody = parsedOutput.body;
1597
+ const $metadata = deserializeMetadata(output);
1598
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1578
1599
  response = new KMSServiceException_1.KMSServiceException({
1579
- name: parsedBody.code || parsedBody.Code || errorCode,
1600
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1580
1601
  $fault: "client",
1581
- $metadata: deserializeMetadata(output),
1602
+ $metadata,
1582
1603
  });
1583
1604
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1584
1605
  }
@@ -1603,8 +1624,7 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = async
1603
1624
  body: await parseBody(output.body, context),
1604
1625
  };
1605
1626
  let response;
1606
- let errorCode = "UnknownError";
1607
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1627
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1608
1628
  switch (errorCode) {
1609
1629
  case "DependencyTimeoutException":
1610
1630
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1632,10 +1652,12 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = async
1632
1652
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1633
1653
  default:
1634
1654
  const parsedBody = parsedOutput.body;
1655
+ const $metadata = deserializeMetadata(output);
1656
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1635
1657
  response = new KMSServiceException_1.KMSServiceException({
1636
- name: parsedBody.code || parsedBody.Code || errorCode,
1658
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1637
1659
  $fault: "client",
1638
- $metadata: deserializeMetadata(output),
1660
+ $metadata,
1639
1661
  });
1640
1662
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1641
1663
  }
@@ -1660,8 +1682,7 @@ const deserializeAws_json1_1GenerateMacCommandError = async (output, context) =>
1660
1682
  body: await parseBody(output.body, context),
1661
1683
  };
1662
1684
  let response;
1663
- let errorCode = "UnknownError";
1664
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1685
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1665
1686
  switch (errorCode) {
1666
1687
  case "DisabledException":
1667
1688
  case "com.amazonaws.kms#DisabledException":
@@ -1686,10 +1707,12 @@ const deserializeAws_json1_1GenerateMacCommandError = async (output, context) =>
1686
1707
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1687
1708
  default:
1688
1709
  const parsedBody = parsedOutput.body;
1710
+ const $metadata = deserializeMetadata(output);
1711
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1689
1712
  response = new KMSServiceException_1.KMSServiceException({
1690
- name: parsedBody.code || parsedBody.Code || errorCode,
1713
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1691
1714
  $fault: "client",
1692
- $metadata: deserializeMetadata(output),
1715
+ $metadata,
1693
1716
  });
1694
1717
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1695
1718
  }
@@ -1714,8 +1737,7 @@ const deserializeAws_json1_1GenerateRandomCommandError = async (output, context)
1714
1737
  body: await parseBody(output.body, context),
1715
1738
  };
1716
1739
  let response;
1717
- let errorCode = "UnknownError";
1718
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1740
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1719
1741
  switch (errorCode) {
1720
1742
  case "CustomKeyStoreInvalidStateException":
1721
1743
  case "com.amazonaws.kms#CustomKeyStoreInvalidStateException":
@@ -1731,10 +1753,12 @@ const deserializeAws_json1_1GenerateRandomCommandError = async (output, context)
1731
1753
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
1732
1754
  default:
1733
1755
  const parsedBody = parsedOutput.body;
1756
+ const $metadata = deserializeMetadata(output);
1757
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1734
1758
  response = new KMSServiceException_1.KMSServiceException({
1735
- name: parsedBody.code || parsedBody.Code || errorCode,
1759
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1736
1760
  $fault: "client",
1737
- $metadata: deserializeMetadata(output),
1761
+ $metadata,
1738
1762
  });
1739
1763
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1740
1764
  }
@@ -1759,8 +1783,7 @@ const deserializeAws_json1_1GetKeyPolicyCommandError = async (output, context) =
1759
1783
  body: await parseBody(output.body, context),
1760
1784
  };
1761
1785
  let response;
1762
- let errorCode = "UnknownError";
1763
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1786
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1764
1787
  switch (errorCode) {
1765
1788
  case "DependencyTimeoutException":
1766
1789
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1779,10 +1802,12 @@ const deserializeAws_json1_1GetKeyPolicyCommandError = async (output, context) =
1779
1802
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1780
1803
  default:
1781
1804
  const parsedBody = parsedOutput.body;
1805
+ const $metadata = deserializeMetadata(output);
1806
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1782
1807
  response = new KMSServiceException_1.KMSServiceException({
1783
- name: parsedBody.code || parsedBody.Code || errorCode,
1808
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1784
1809
  $fault: "client",
1785
- $metadata: deserializeMetadata(output),
1810
+ $metadata,
1786
1811
  });
1787
1812
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1788
1813
  }
@@ -1807,8 +1832,7 @@ const deserializeAws_json1_1GetKeyRotationStatusCommandError = async (output, co
1807
1832
  body: await parseBody(output.body, context),
1808
1833
  };
1809
1834
  let response;
1810
- let errorCode = "UnknownError";
1811
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1835
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1812
1836
  switch (errorCode) {
1813
1837
  case "DependencyTimeoutException":
1814
1838
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1830,10 +1854,12 @@ const deserializeAws_json1_1GetKeyRotationStatusCommandError = async (output, co
1830
1854
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1831
1855
  default:
1832
1856
  const parsedBody = parsedOutput.body;
1857
+ const $metadata = deserializeMetadata(output);
1858
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1833
1859
  response = new KMSServiceException_1.KMSServiceException({
1834
- name: parsedBody.code || parsedBody.Code || errorCode,
1860
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1835
1861
  $fault: "client",
1836
- $metadata: deserializeMetadata(output),
1862
+ $metadata,
1837
1863
  });
1838
1864
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1839
1865
  }
@@ -1858,8 +1884,7 @@ const deserializeAws_json1_1GetParametersForImportCommandError = async (output,
1858
1884
  body: await parseBody(output.body, context),
1859
1885
  };
1860
1886
  let response;
1861
- let errorCode = "UnknownError";
1862
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1887
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1863
1888
  switch (errorCode) {
1864
1889
  case "DependencyTimeoutException":
1865
1890
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1881,10 +1906,12 @@ const deserializeAws_json1_1GetParametersForImportCommandError = async (output,
1881
1906
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1882
1907
  default:
1883
1908
  const parsedBody = parsedOutput.body;
1909
+ const $metadata = deserializeMetadata(output);
1910
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1884
1911
  response = new KMSServiceException_1.KMSServiceException({
1885
- name: parsedBody.code || parsedBody.Code || errorCode,
1912
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1886
1913
  $fault: "client",
1887
- $metadata: deserializeMetadata(output),
1914
+ $metadata,
1888
1915
  });
1889
1916
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1890
1917
  }
@@ -1909,8 +1936,7 @@ const deserializeAws_json1_1GetPublicKeyCommandError = async (output, context) =
1909
1936
  body: await parseBody(output.body, context),
1910
1937
  };
1911
1938
  let response;
1912
- let errorCode = "UnknownError";
1913
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1939
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1914
1940
  switch (errorCode) {
1915
1941
  case "DependencyTimeoutException":
1916
1942
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -1944,10 +1970,12 @@ const deserializeAws_json1_1GetPublicKeyCommandError = async (output, context) =
1944
1970
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
1945
1971
  default:
1946
1972
  const parsedBody = parsedOutput.body;
1973
+ const $metadata = deserializeMetadata(output);
1974
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1947
1975
  response = new KMSServiceException_1.KMSServiceException({
1948
- name: parsedBody.code || parsedBody.Code || errorCode,
1976
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1949
1977
  $fault: "client",
1950
- $metadata: deserializeMetadata(output),
1978
+ $metadata,
1951
1979
  });
1952
1980
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1953
1981
  }
@@ -1972,8 +2000,7 @@ const deserializeAws_json1_1ImportKeyMaterialCommandError = async (output, conte
1972
2000
  body: await parseBody(output.body, context),
1973
2001
  };
1974
2002
  let response;
1975
- let errorCode = "UnknownError";
1976
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2003
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1977
2004
  switch (errorCode) {
1978
2005
  case "DependencyTimeoutException":
1979
2006
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2007,10 +2034,12 @@ const deserializeAws_json1_1ImportKeyMaterialCommandError = async (output, conte
2007
2034
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
2008
2035
  default:
2009
2036
  const parsedBody = parsedOutput.body;
2037
+ const $metadata = deserializeMetadata(output);
2038
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2010
2039
  response = new KMSServiceException_1.KMSServiceException({
2011
- name: parsedBody.code || parsedBody.Code || errorCode,
2040
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2012
2041
  $fault: "client",
2013
- $metadata: deserializeMetadata(output),
2042
+ $metadata,
2014
2043
  });
2015
2044
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2016
2045
  }
@@ -2035,8 +2064,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async (output, context) =>
2035
2064
  body: await parseBody(output.body, context),
2036
2065
  };
2037
2066
  let response;
2038
- let errorCode = "UnknownError";
2039
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2067
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2040
2068
  switch (errorCode) {
2041
2069
  case "DependencyTimeoutException":
2042
2070
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2055,10 +2083,12 @@ const deserializeAws_json1_1ListAliasesCommandError = async (output, context) =>
2055
2083
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2056
2084
  default:
2057
2085
  const parsedBody = parsedOutput.body;
2086
+ const $metadata = deserializeMetadata(output);
2087
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2058
2088
  response = new KMSServiceException_1.KMSServiceException({
2059
- name: parsedBody.code || parsedBody.Code || errorCode,
2089
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2060
2090
  $fault: "client",
2061
- $metadata: deserializeMetadata(output),
2091
+ $metadata,
2062
2092
  });
2063
2093
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2064
2094
  }
@@ -2083,8 +2113,7 @@ const deserializeAws_json1_1ListGrantsCommandError = async (output, context) =>
2083
2113
  body: await parseBody(output.body, context),
2084
2114
  };
2085
2115
  let response;
2086
- let errorCode = "UnknownError";
2087
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2116
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2088
2117
  switch (errorCode) {
2089
2118
  case "DependencyTimeoutException":
2090
2119
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2109,10 +2138,12 @@ const deserializeAws_json1_1ListGrantsCommandError = async (output, context) =>
2109
2138
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2110
2139
  default:
2111
2140
  const parsedBody = parsedOutput.body;
2141
+ const $metadata = deserializeMetadata(output);
2142
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2112
2143
  response = new KMSServiceException_1.KMSServiceException({
2113
- name: parsedBody.code || parsedBody.Code || errorCode,
2144
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2114
2145
  $fault: "client",
2115
- $metadata: deserializeMetadata(output),
2146
+ $metadata,
2116
2147
  });
2117
2148
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2118
2149
  }
@@ -2137,8 +2168,7 @@ const deserializeAws_json1_1ListKeyPoliciesCommandError = async (output, context
2137
2168
  body: await parseBody(output.body, context),
2138
2169
  };
2139
2170
  let response;
2140
- let errorCode = "UnknownError";
2141
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2171
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2142
2172
  switch (errorCode) {
2143
2173
  case "DependencyTimeoutException":
2144
2174
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2157,10 +2187,12 @@ const deserializeAws_json1_1ListKeyPoliciesCommandError = async (output, context
2157
2187
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2158
2188
  default:
2159
2189
  const parsedBody = parsedOutput.body;
2190
+ const $metadata = deserializeMetadata(output);
2191
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2160
2192
  response = new KMSServiceException_1.KMSServiceException({
2161
- name: parsedBody.code || parsedBody.Code || errorCode,
2193
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2162
2194
  $fault: "client",
2163
- $metadata: deserializeMetadata(output),
2195
+ $metadata,
2164
2196
  });
2165
2197
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2166
2198
  }
@@ -2185,8 +2217,7 @@ const deserializeAws_json1_1ListKeysCommandError = async (output, context) => {
2185
2217
  body: await parseBody(output.body, context),
2186
2218
  };
2187
2219
  let response;
2188
- let errorCode = "UnknownError";
2189
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2220
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2190
2221
  switch (errorCode) {
2191
2222
  case "DependencyTimeoutException":
2192
2223
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2199,10 +2230,12 @@ const deserializeAws_json1_1ListKeysCommandError = async (output, context) => {
2199
2230
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
2200
2231
  default:
2201
2232
  const parsedBody = parsedOutput.body;
2233
+ const $metadata = deserializeMetadata(output);
2234
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2202
2235
  response = new KMSServiceException_1.KMSServiceException({
2203
- name: parsedBody.code || parsedBody.Code || errorCode,
2236
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2204
2237
  $fault: "client",
2205
- $metadata: deserializeMetadata(output),
2238
+ $metadata,
2206
2239
  });
2207
2240
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2208
2241
  }
@@ -2227,8 +2260,7 @@ const deserializeAws_json1_1ListResourceTagsCommandError = async (output, contex
2227
2260
  body: await parseBody(output.body, context),
2228
2261
  };
2229
2262
  let response;
2230
- let errorCode = "UnknownError";
2231
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2263
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2232
2264
  switch (errorCode) {
2233
2265
  case "InvalidArnException":
2234
2266
  case "com.amazonaws.kms#InvalidArnException":
@@ -2244,10 +2276,12 @@ const deserializeAws_json1_1ListResourceTagsCommandError = async (output, contex
2244
2276
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2245
2277
  default:
2246
2278
  const parsedBody = parsedOutput.body;
2279
+ const $metadata = deserializeMetadata(output);
2280
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2247
2281
  response = new KMSServiceException_1.KMSServiceException({
2248
- name: parsedBody.code || parsedBody.Code || errorCode,
2282
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2249
2283
  $fault: "client",
2250
- $metadata: deserializeMetadata(output),
2284
+ $metadata,
2251
2285
  });
2252
2286
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2253
2287
  }
@@ -2272,8 +2306,7 @@ const deserializeAws_json1_1ListRetirableGrantsCommandError = async (output, con
2272
2306
  body: await parseBody(output.body, context),
2273
2307
  };
2274
2308
  let response;
2275
- let errorCode = "UnknownError";
2276
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2309
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2277
2310
  switch (errorCode) {
2278
2311
  case "DependencyTimeoutException":
2279
2312
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2292,10 +2325,12 @@ const deserializeAws_json1_1ListRetirableGrantsCommandError = async (output, con
2292
2325
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2293
2326
  default:
2294
2327
  const parsedBody = parsedOutput.body;
2328
+ const $metadata = deserializeMetadata(output);
2329
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2295
2330
  response = new KMSServiceException_1.KMSServiceException({
2296
- name: parsedBody.code || parsedBody.Code || errorCode,
2331
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2297
2332
  $fault: "client",
2298
- $metadata: deserializeMetadata(output),
2333
+ $metadata,
2299
2334
  });
2300
2335
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2301
2336
  }
@@ -2317,8 +2352,7 @@ const deserializeAws_json1_1PutKeyPolicyCommandError = async (output, context) =
2317
2352
  body: await parseBody(output.body, context),
2318
2353
  };
2319
2354
  let response;
2320
- let errorCode = "UnknownError";
2321
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2355
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2322
2356
  switch (errorCode) {
2323
2357
  case "DependencyTimeoutException":
2324
2358
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2346,10 +2380,12 @@ const deserializeAws_json1_1PutKeyPolicyCommandError = async (output, context) =
2346
2380
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
2347
2381
  default:
2348
2382
  const parsedBody = parsedOutput.body;
2383
+ const $metadata = deserializeMetadata(output);
2384
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2349
2385
  response = new KMSServiceException_1.KMSServiceException({
2350
- name: parsedBody.code || parsedBody.Code || errorCode,
2386
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2351
2387
  $fault: "client",
2352
- $metadata: deserializeMetadata(output),
2388
+ $metadata,
2353
2389
  });
2354
2390
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2355
2391
  }
@@ -2374,8 +2410,7 @@ const deserializeAws_json1_1ReEncryptCommandError = async (output, context) => {
2374
2410
  body: await parseBody(output.body, context),
2375
2411
  };
2376
2412
  let response;
2377
- let errorCode = "UnknownError";
2378
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2413
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2379
2414
  switch (errorCode) {
2380
2415
  case "DependencyTimeoutException":
2381
2416
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2409,10 +2444,12 @@ const deserializeAws_json1_1ReEncryptCommandError = async (output, context) => {
2409
2444
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2410
2445
  default:
2411
2446
  const parsedBody = parsedOutput.body;
2447
+ const $metadata = deserializeMetadata(output);
2448
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2412
2449
  response = new KMSServiceException_1.KMSServiceException({
2413
- name: parsedBody.code || parsedBody.Code || errorCode,
2450
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2414
2451
  $fault: "client",
2415
- $metadata: deserializeMetadata(output),
2452
+ $metadata,
2416
2453
  });
2417
2454
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2418
2455
  }
@@ -2437,8 +2474,7 @@ const deserializeAws_json1_1ReplicateKeyCommandError = async (output, context) =
2437
2474
  body: await parseBody(output.body, context),
2438
2475
  };
2439
2476
  let response;
2440
- let errorCode = "UnknownError";
2441
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2477
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2442
2478
  switch (errorCode) {
2443
2479
  case "AlreadyExistsException":
2444
2480
  case "com.amazonaws.kms#AlreadyExistsException":
@@ -2472,10 +2508,12 @@ const deserializeAws_json1_1ReplicateKeyCommandError = async (output, context) =
2472
2508
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
2473
2509
  default:
2474
2510
  const parsedBody = parsedOutput.body;
2511
+ const $metadata = deserializeMetadata(output);
2512
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2475
2513
  response = new KMSServiceException_1.KMSServiceException({
2476
- name: parsedBody.code || parsedBody.Code || errorCode,
2514
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2477
2515
  $fault: "client",
2478
- $metadata: deserializeMetadata(output),
2516
+ $metadata,
2479
2517
  });
2480
2518
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2481
2519
  }
@@ -2497,8 +2535,7 @@ const deserializeAws_json1_1RetireGrantCommandError = async (output, context) =>
2497
2535
  body: await parseBody(output.body, context),
2498
2536
  };
2499
2537
  let response;
2500
- let errorCode = "UnknownError";
2501
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2538
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2502
2539
  switch (errorCode) {
2503
2540
  case "DependencyTimeoutException":
2504
2541
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2523,10 +2560,12 @@ const deserializeAws_json1_1RetireGrantCommandError = async (output, context) =>
2523
2560
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2524
2561
  default:
2525
2562
  const parsedBody = parsedOutput.body;
2563
+ const $metadata = deserializeMetadata(output);
2564
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2526
2565
  response = new KMSServiceException_1.KMSServiceException({
2527
- name: parsedBody.code || parsedBody.Code || errorCode,
2566
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2528
2567
  $fault: "client",
2529
- $metadata: deserializeMetadata(output),
2568
+ $metadata,
2530
2569
  });
2531
2570
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2532
2571
  }
@@ -2548,8 +2587,7 @@ const deserializeAws_json1_1RevokeGrantCommandError = async (output, context) =>
2548
2587
  body: await parseBody(output.body, context),
2549
2588
  };
2550
2589
  let response;
2551
- let errorCode = "UnknownError";
2552
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2590
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2553
2591
  switch (errorCode) {
2554
2592
  case "DependencyTimeoutException":
2555
2593
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2571,10 +2609,12 @@ const deserializeAws_json1_1RevokeGrantCommandError = async (output, context) =>
2571
2609
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2572
2610
  default:
2573
2611
  const parsedBody = parsedOutput.body;
2612
+ const $metadata = deserializeMetadata(output);
2613
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2574
2614
  response = new KMSServiceException_1.KMSServiceException({
2575
- name: parsedBody.code || parsedBody.Code || errorCode,
2615
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2576
2616
  $fault: "client",
2577
- $metadata: deserializeMetadata(output),
2617
+ $metadata,
2578
2618
  });
2579
2619
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2580
2620
  }
@@ -2599,8 +2639,7 @@ const deserializeAws_json1_1ScheduleKeyDeletionCommandError = async (output, con
2599
2639
  body: await parseBody(output.body, context),
2600
2640
  };
2601
2641
  let response;
2602
- let errorCode = "UnknownError";
2603
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2642
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2604
2643
  switch (errorCode) {
2605
2644
  case "DependencyTimeoutException":
2606
2645
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2619,10 +2658,12 @@ const deserializeAws_json1_1ScheduleKeyDeletionCommandError = async (output, con
2619
2658
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2620
2659
  default:
2621
2660
  const parsedBody = parsedOutput.body;
2661
+ const $metadata = deserializeMetadata(output);
2662
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2622
2663
  response = new KMSServiceException_1.KMSServiceException({
2623
- name: parsedBody.code || parsedBody.Code || errorCode,
2664
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2624
2665
  $fault: "client",
2625
- $metadata: deserializeMetadata(output),
2666
+ $metadata,
2626
2667
  });
2627
2668
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2628
2669
  }
@@ -2647,8 +2688,7 @@ const deserializeAws_json1_1SignCommandError = async (output, context) => {
2647
2688
  body: await parseBody(output.body, context),
2648
2689
  };
2649
2690
  let response;
2650
- let errorCode = "UnknownError";
2651
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2691
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2652
2692
  switch (errorCode) {
2653
2693
  case "DependencyTimeoutException":
2654
2694
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2676,10 +2716,12 @@ const deserializeAws_json1_1SignCommandError = async (output, context) => {
2676
2716
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2677
2717
  default:
2678
2718
  const parsedBody = parsedOutput.body;
2719
+ const $metadata = deserializeMetadata(output);
2720
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2679
2721
  response = new KMSServiceException_1.KMSServiceException({
2680
- name: parsedBody.code || parsedBody.Code || errorCode,
2722
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2681
2723
  $fault: "client",
2682
- $metadata: deserializeMetadata(output),
2724
+ $metadata,
2683
2725
  });
2684
2726
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2685
2727
  }
@@ -2701,8 +2743,7 @@ const deserializeAws_json1_1TagResourceCommandError = async (output, context) =>
2701
2743
  body: await parseBody(output.body, context),
2702
2744
  };
2703
2745
  let response;
2704
- let errorCode = "UnknownError";
2705
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2746
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2706
2747
  switch (errorCode) {
2707
2748
  case "InvalidArnException":
2708
2749
  case "com.amazonaws.kms#InvalidArnException":
@@ -2724,10 +2765,12 @@ const deserializeAws_json1_1TagResourceCommandError = async (output, context) =>
2724
2765
  throw await deserializeAws_json1_1TagExceptionResponse(parsedOutput, context);
2725
2766
  default:
2726
2767
  const parsedBody = parsedOutput.body;
2768
+ const $metadata = deserializeMetadata(output);
2769
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2727
2770
  response = new KMSServiceException_1.KMSServiceException({
2728
- name: parsedBody.code || parsedBody.Code || errorCode,
2771
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2729
2772
  $fault: "client",
2730
- $metadata: deserializeMetadata(output),
2773
+ $metadata,
2731
2774
  });
2732
2775
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2733
2776
  }
@@ -2749,8 +2792,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async (output, context)
2749
2792
  body: await parseBody(output.body, context),
2750
2793
  };
2751
2794
  let response;
2752
- let errorCode = "UnknownError";
2753
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2795
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2754
2796
  switch (errorCode) {
2755
2797
  case "InvalidArnException":
2756
2798
  case "com.amazonaws.kms#InvalidArnException":
@@ -2769,10 +2811,12 @@ const deserializeAws_json1_1UntagResourceCommandError = async (output, context)
2769
2811
  throw await deserializeAws_json1_1TagExceptionResponse(parsedOutput, context);
2770
2812
  default:
2771
2813
  const parsedBody = parsedOutput.body;
2814
+ const $metadata = deserializeMetadata(output);
2815
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2772
2816
  response = new KMSServiceException_1.KMSServiceException({
2773
- name: parsedBody.code || parsedBody.Code || errorCode,
2817
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2774
2818
  $fault: "client",
2775
- $metadata: deserializeMetadata(output),
2819
+ $metadata,
2776
2820
  });
2777
2821
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2778
2822
  }
@@ -2794,8 +2838,7 @@ const deserializeAws_json1_1UpdateAliasCommandError = async (output, context) =>
2794
2838
  body: await parseBody(output.body, context),
2795
2839
  };
2796
2840
  let response;
2797
- let errorCode = "UnknownError";
2798
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2841
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2799
2842
  switch (errorCode) {
2800
2843
  case "DependencyTimeoutException":
2801
2844
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2814,10 +2857,12 @@ const deserializeAws_json1_1UpdateAliasCommandError = async (output, context) =>
2814
2857
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2815
2858
  default:
2816
2859
  const parsedBody = parsedOutput.body;
2860
+ const $metadata = deserializeMetadata(output);
2861
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2817
2862
  response = new KMSServiceException_1.KMSServiceException({
2818
- name: parsedBody.code || parsedBody.Code || errorCode,
2863
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2819
2864
  $fault: "client",
2820
- $metadata: deserializeMetadata(output),
2865
+ $metadata,
2821
2866
  });
2822
2867
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2823
2868
  }
@@ -2842,8 +2887,7 @@ const deserializeAws_json1_1UpdateCustomKeyStoreCommandError = async (output, co
2842
2887
  body: await parseBody(output.body, context),
2843
2888
  };
2844
2889
  let response;
2845
- let errorCode = "UnknownError";
2846
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2890
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2847
2891
  switch (errorCode) {
2848
2892
  case "CloudHsmClusterInvalidConfigurationException":
2849
2893
  case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException":
@@ -2871,10 +2915,12 @@ const deserializeAws_json1_1UpdateCustomKeyStoreCommandError = async (output, co
2871
2915
  throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
2872
2916
  default:
2873
2917
  const parsedBody = parsedOutput.body;
2918
+ const $metadata = deserializeMetadata(output);
2919
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2874
2920
  response = new KMSServiceException_1.KMSServiceException({
2875
- name: parsedBody.code || parsedBody.Code || errorCode,
2921
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2876
2922
  $fault: "client",
2877
- $metadata: deserializeMetadata(output),
2923
+ $metadata,
2878
2924
  });
2879
2925
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2880
2926
  }
@@ -2896,8 +2942,7 @@ const deserializeAws_json1_1UpdateKeyDescriptionCommandError = async (output, co
2896
2942
  body: await parseBody(output.body, context),
2897
2943
  };
2898
2944
  let response;
2899
- let errorCode = "UnknownError";
2900
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2945
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2901
2946
  switch (errorCode) {
2902
2947
  case "DependencyTimeoutException":
2903
2948
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -2916,10 +2961,12 @@ const deserializeAws_json1_1UpdateKeyDescriptionCommandError = async (output, co
2916
2961
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2917
2962
  default:
2918
2963
  const parsedBody = parsedOutput.body;
2964
+ const $metadata = deserializeMetadata(output);
2965
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2919
2966
  response = new KMSServiceException_1.KMSServiceException({
2920
- name: parsedBody.code || parsedBody.Code || errorCode,
2967
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2921
2968
  $fault: "client",
2922
- $metadata: deserializeMetadata(output),
2969
+ $metadata,
2923
2970
  });
2924
2971
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2925
2972
  }
@@ -2941,8 +2988,7 @@ const deserializeAws_json1_1UpdatePrimaryRegionCommandError = async (output, con
2941
2988
  body: await parseBody(output.body, context),
2942
2989
  };
2943
2990
  let response;
2944
- let errorCode = "UnknownError";
2945
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2991
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2946
2992
  switch (errorCode) {
2947
2993
  case "DisabledException":
2948
2994
  case "com.amazonaws.kms#DisabledException":
@@ -2964,10 +3010,12 @@ const deserializeAws_json1_1UpdatePrimaryRegionCommandError = async (output, con
2964
3010
  throw await deserializeAws_json1_1UnsupportedOperationExceptionResponse(parsedOutput, context);
2965
3011
  default:
2966
3012
  const parsedBody = parsedOutput.body;
3013
+ const $metadata = deserializeMetadata(output);
3014
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2967
3015
  response = new KMSServiceException_1.KMSServiceException({
2968
- name: parsedBody.code || parsedBody.Code || errorCode,
3016
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2969
3017
  $fault: "client",
2970
- $metadata: deserializeMetadata(output),
3018
+ $metadata,
2971
3019
  });
2972
3020
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2973
3021
  }
@@ -2992,8 +3040,7 @@ const deserializeAws_json1_1VerifyCommandError = async (output, context) => {
2992
3040
  body: await parseBody(output.body, context),
2993
3041
  };
2994
3042
  let response;
2995
- let errorCode = "UnknownError";
2996
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3043
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2997
3044
  switch (errorCode) {
2998
3045
  case "DependencyTimeoutException":
2999
3046
  case "com.amazonaws.kms#DependencyTimeoutException":
@@ -3024,10 +3071,12 @@ const deserializeAws_json1_1VerifyCommandError = async (output, context) => {
3024
3071
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
3025
3072
  default:
3026
3073
  const parsedBody = parsedOutput.body;
3074
+ const $metadata = deserializeMetadata(output);
3075
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3027
3076
  response = new KMSServiceException_1.KMSServiceException({
3028
- name: parsedBody.code || parsedBody.Code || errorCode,
3077
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3029
3078
  $fault: "client",
3030
- $metadata: deserializeMetadata(output),
3079
+ $metadata,
3031
3080
  });
3032
3081
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3033
3082
  }
@@ -3052,8 +3101,7 @@ const deserializeAws_json1_1VerifyMacCommandError = async (output, context) => {
3052
3101
  body: await parseBody(output.body, context),
3053
3102
  };
3054
3103
  let response;
3055
- let errorCode = "UnknownError";
3056
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3104
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3057
3105
  switch (errorCode) {
3058
3106
  case "DisabledException":
3059
3107
  case "com.amazonaws.kms#DisabledException":
@@ -3081,10 +3129,12 @@ const deserializeAws_json1_1VerifyMacCommandError = async (output, context) => {
3081
3129
  throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
3082
3130
  default:
3083
3131
  const parsedBody = parsedOutput.body;
3132
+ const $metadata = deserializeMetadata(output);
3133
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3084
3134
  response = new KMSServiceException_1.KMSServiceException({
3085
- name: parsedBody.code || parsedBody.Code || errorCode,
3135
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3086
3136
  $fault: "client",
3087
- $metadata: deserializeMetadata(output),
3137
+ $metadata,
3088
3138
  });
3089
3139
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3090
3140
  }
@@ -3397,140 +3447,118 @@ const deserializeAws_json1_1UnsupportedOperationExceptionResponse = async (parse
3397
3447
  };
3398
3448
  const serializeAws_json1_1CancelKeyDeletionRequest = (input, context) => {
3399
3449
  return {
3400
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3450
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3401
3451
  };
3402
3452
  };
3403
3453
  const serializeAws_json1_1ConnectCustomKeyStoreRequest = (input, context) => {
3404
3454
  return {
3405
- ...(input.CustomKeyStoreId !== undefined &&
3406
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3455
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3407
3456
  };
3408
3457
  };
3409
3458
  const serializeAws_json1_1CreateAliasRequest = (input, context) => {
3410
3459
  return {
3411
- ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }),
3412
- ...(input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }),
3460
+ ...(input.AliasName != null && { AliasName: input.AliasName }),
3461
+ ...(input.TargetKeyId != null && { TargetKeyId: input.TargetKeyId }),
3413
3462
  };
3414
3463
  };
3415
3464
  const serializeAws_json1_1CreateCustomKeyStoreRequest = (input, context) => {
3416
3465
  return {
3417
- ...(input.CloudHsmClusterId !== undefined &&
3418
- input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId }),
3419
- ...(input.CustomKeyStoreName !== undefined &&
3420
- input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName }),
3421
- ...(input.KeyStorePassword !== undefined &&
3422
- input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword }),
3423
- ...(input.TrustAnchorCertificate !== undefined &&
3424
- input.TrustAnchorCertificate !== null && { TrustAnchorCertificate: input.TrustAnchorCertificate }),
3466
+ ...(input.CloudHsmClusterId != null && { CloudHsmClusterId: input.CloudHsmClusterId }),
3467
+ ...(input.CustomKeyStoreName != null && { CustomKeyStoreName: input.CustomKeyStoreName }),
3468
+ ...(input.KeyStorePassword != null && { KeyStorePassword: input.KeyStorePassword }),
3469
+ ...(input.TrustAnchorCertificate != null && { TrustAnchorCertificate: input.TrustAnchorCertificate }),
3425
3470
  };
3426
3471
  };
3427
3472
  const serializeAws_json1_1CreateGrantRequest = (input, context) => {
3428
3473
  return {
3429
- ...(input.Constraints !== undefined &&
3430
- input.Constraints !== null && { Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context) }),
3431
- ...(input.GrantTokens !== undefined &&
3432
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3433
- ...(input.GranteePrincipal !== undefined &&
3434
- input.GranteePrincipal !== null && { GranteePrincipal: input.GranteePrincipal }),
3435
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3436
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
3437
- ...(input.Operations !== undefined &&
3438
- input.Operations !== null && { Operations: serializeAws_json1_1GrantOperationList(input.Operations, context) }),
3439
- ...(input.RetiringPrincipal !== undefined &&
3440
- input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }),
3474
+ ...(input.Constraints != null && { Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context) }),
3475
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3476
+ ...(input.GranteePrincipal != null && { GranteePrincipal: input.GranteePrincipal }),
3477
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3478
+ ...(input.Name != null && { Name: input.Name }),
3479
+ ...(input.Operations != null && { Operations: serializeAws_json1_1GrantOperationList(input.Operations, context) }),
3480
+ ...(input.RetiringPrincipal != null && { RetiringPrincipal: input.RetiringPrincipal }),
3441
3481
  };
3442
3482
  };
3443
3483
  const serializeAws_json1_1CreateKeyRequest = (input, context) => {
3444
3484
  return {
3445
- ...(input.BypassPolicyLockoutSafetyCheck !== undefined &&
3446
- input.BypassPolicyLockoutSafetyCheck !== null && {
3485
+ ...(input.BypassPolicyLockoutSafetyCheck != null && {
3447
3486
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
3448
3487
  }),
3449
- ...(input.CustomKeyStoreId !== undefined &&
3450
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3451
- ...(input.CustomerMasterKeySpec !== undefined &&
3452
- input.CustomerMasterKeySpec !== null && { CustomerMasterKeySpec: input.CustomerMasterKeySpec }),
3453
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3454
- ...(input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec }),
3455
- ...(input.KeyUsage !== undefined && input.KeyUsage !== null && { KeyUsage: input.KeyUsage }),
3456
- ...(input.MultiRegion !== undefined && input.MultiRegion !== null && { MultiRegion: input.MultiRegion }),
3457
- ...(input.Origin !== undefined && input.Origin !== null && { Origin: input.Origin }),
3458
- ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }),
3459
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3488
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3489
+ ...(input.CustomerMasterKeySpec != null && { CustomerMasterKeySpec: input.CustomerMasterKeySpec }),
3490
+ ...(input.Description != null && { Description: input.Description }),
3491
+ ...(input.KeySpec != null && { KeySpec: input.KeySpec }),
3492
+ ...(input.KeyUsage != null && { KeyUsage: input.KeyUsage }),
3493
+ ...(input.MultiRegion != null && { MultiRegion: input.MultiRegion }),
3494
+ ...(input.Origin != null && { Origin: input.Origin }),
3495
+ ...(input.Policy != null && { Policy: input.Policy }),
3496
+ ...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3460
3497
  };
3461
3498
  };
3462
3499
  const serializeAws_json1_1DecryptRequest = (input, context) => {
3463
3500
  return {
3464
- ...(input.CiphertextBlob !== undefined &&
3465
- input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }),
3466
- ...(input.EncryptionAlgorithm !== undefined &&
3467
- input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm }),
3468
- ...(input.EncryptionContext !== undefined &&
3469
- input.EncryptionContext !== null && {
3501
+ ...(input.CiphertextBlob != null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }),
3502
+ ...(input.EncryptionAlgorithm != null && { EncryptionAlgorithm: input.EncryptionAlgorithm }),
3503
+ ...(input.EncryptionContext != null && {
3470
3504
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3471
3505
  }),
3472
- ...(input.GrantTokens !== undefined &&
3473
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3474
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3506
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3507
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3475
3508
  };
3476
3509
  };
3477
3510
  const serializeAws_json1_1DeleteAliasRequest = (input, context) => {
3478
3511
  return {
3479
- ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }),
3512
+ ...(input.AliasName != null && { AliasName: input.AliasName }),
3480
3513
  };
3481
3514
  };
3482
3515
  const serializeAws_json1_1DeleteCustomKeyStoreRequest = (input, context) => {
3483
3516
  return {
3484
- ...(input.CustomKeyStoreId !== undefined &&
3485
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3517
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3486
3518
  };
3487
3519
  };
3488
3520
  const serializeAws_json1_1DeleteImportedKeyMaterialRequest = (input, context) => {
3489
3521
  return {
3490
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3522
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3491
3523
  };
3492
3524
  };
3493
3525
  const serializeAws_json1_1DescribeCustomKeyStoresRequest = (input, context) => {
3494
3526
  return {
3495
- ...(input.CustomKeyStoreId !== undefined &&
3496
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3497
- ...(input.CustomKeyStoreName !== undefined &&
3498
- input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName }),
3499
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3500
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3527
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3528
+ ...(input.CustomKeyStoreName != null && { CustomKeyStoreName: input.CustomKeyStoreName }),
3529
+ ...(input.Limit != null && { Limit: input.Limit }),
3530
+ ...(input.Marker != null && { Marker: input.Marker }),
3501
3531
  };
3502
3532
  };
3503
3533
  const serializeAws_json1_1DescribeKeyRequest = (input, context) => {
3504
3534
  return {
3505
- ...(input.GrantTokens !== undefined &&
3506
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3507
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3535
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3536
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3508
3537
  };
3509
3538
  };
3510
3539
  const serializeAws_json1_1DisableKeyRequest = (input, context) => {
3511
3540
  return {
3512
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3541
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3513
3542
  };
3514
3543
  };
3515
3544
  const serializeAws_json1_1DisableKeyRotationRequest = (input, context) => {
3516
3545
  return {
3517
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3546
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3518
3547
  };
3519
3548
  };
3520
3549
  const serializeAws_json1_1DisconnectCustomKeyStoreRequest = (input, context) => {
3521
3550
  return {
3522
- ...(input.CustomKeyStoreId !== undefined &&
3523
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3551
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3524
3552
  };
3525
3553
  };
3526
3554
  const serializeAws_json1_1EnableKeyRequest = (input, context) => {
3527
3555
  return {
3528
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3556
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3529
3557
  };
3530
3558
  };
3531
3559
  const serializeAws_json1_1EnableKeyRotationRequest = (input, context) => {
3532
3560
  return {
3533
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3561
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3534
3562
  };
3535
3563
  };
3536
3564
  const serializeAws_json1_1EncryptionContextType = (input, context) => {
@@ -3546,120 +3574,101 @@ const serializeAws_json1_1EncryptionContextType = (input, context) => {
3546
3574
  };
3547
3575
  const serializeAws_json1_1EncryptRequest = (input, context) => {
3548
3576
  return {
3549
- ...(input.EncryptionAlgorithm !== undefined &&
3550
- input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm }),
3551
- ...(input.EncryptionContext !== undefined &&
3552
- input.EncryptionContext !== null && {
3577
+ ...(input.EncryptionAlgorithm != null && { EncryptionAlgorithm: input.EncryptionAlgorithm }),
3578
+ ...(input.EncryptionContext != null && {
3553
3579
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3554
3580
  }),
3555
- ...(input.GrantTokens !== undefined &&
3556
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3557
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3558
- ...(input.Plaintext !== undefined &&
3559
- input.Plaintext !== null && { Plaintext: context.base64Encoder(input.Plaintext) }),
3581
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3582
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3583
+ ...(input.Plaintext != null && { Plaintext: context.base64Encoder(input.Plaintext) }),
3560
3584
  };
3561
3585
  };
3562
3586
  const serializeAws_json1_1GenerateDataKeyPairRequest = (input, context) => {
3563
3587
  return {
3564
- ...(input.EncryptionContext !== undefined &&
3565
- input.EncryptionContext !== null && {
3588
+ ...(input.EncryptionContext != null && {
3566
3589
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3567
3590
  }),
3568
- ...(input.GrantTokens !== undefined &&
3569
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3570
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3571
- ...(input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }),
3591
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3592
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3593
+ ...(input.KeyPairSpec != null && { KeyPairSpec: input.KeyPairSpec }),
3572
3594
  };
3573
3595
  };
3574
3596
  const serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextRequest = (input, context) => {
3575
3597
  return {
3576
- ...(input.EncryptionContext !== undefined &&
3577
- input.EncryptionContext !== null && {
3598
+ ...(input.EncryptionContext != null && {
3578
3599
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3579
3600
  }),
3580
- ...(input.GrantTokens !== undefined &&
3581
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3582
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3583
- ...(input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }),
3601
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3602
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3603
+ ...(input.KeyPairSpec != null && { KeyPairSpec: input.KeyPairSpec }),
3584
3604
  };
3585
3605
  };
3586
3606
  const serializeAws_json1_1GenerateDataKeyRequest = (input, context) => {
3587
3607
  return {
3588
- ...(input.EncryptionContext !== undefined &&
3589
- input.EncryptionContext !== null && {
3608
+ ...(input.EncryptionContext != null && {
3590
3609
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3591
3610
  }),
3592
- ...(input.GrantTokens !== undefined &&
3593
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3594
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3595
- ...(input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec }),
3596
- ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }),
3611
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3612
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3613
+ ...(input.KeySpec != null && { KeySpec: input.KeySpec }),
3614
+ ...(input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }),
3597
3615
  };
3598
3616
  };
3599
3617
  const serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest = (input, context) => {
3600
3618
  return {
3601
- ...(input.EncryptionContext !== undefined &&
3602
- input.EncryptionContext !== null && {
3619
+ ...(input.EncryptionContext != null && {
3603
3620
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
3604
3621
  }),
3605
- ...(input.GrantTokens !== undefined &&
3606
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3607
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3608
- ...(input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec }),
3609
- ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }),
3622
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3623
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3624
+ ...(input.KeySpec != null && { KeySpec: input.KeySpec }),
3625
+ ...(input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }),
3610
3626
  };
3611
3627
  };
3612
3628
  const serializeAws_json1_1GenerateMacRequest = (input, context) => {
3613
3629
  return {
3614
- ...(input.GrantTokens !== undefined &&
3615
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3616
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3617
- ...(input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm }),
3618
- ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3630
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3631
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3632
+ ...(input.MacAlgorithm != null && { MacAlgorithm: input.MacAlgorithm }),
3633
+ ...(input.Message != null && { Message: context.base64Encoder(input.Message) }),
3619
3634
  };
3620
3635
  };
3621
3636
  const serializeAws_json1_1GenerateRandomRequest = (input, context) => {
3622
3637
  return {
3623
- ...(input.CustomKeyStoreId !== undefined &&
3624
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3625
- ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }),
3638
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3639
+ ...(input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }),
3626
3640
  };
3627
3641
  };
3628
3642
  const serializeAws_json1_1GetKeyPolicyRequest = (input, context) => {
3629
3643
  return {
3630
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3631
- ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }),
3644
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3645
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
3632
3646
  };
3633
3647
  };
3634
3648
  const serializeAws_json1_1GetKeyRotationStatusRequest = (input, context) => {
3635
3649
  return {
3636
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3650
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3637
3651
  };
3638
3652
  };
3639
3653
  const serializeAws_json1_1GetParametersForImportRequest = (input, context) => {
3640
3654
  return {
3641
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3642
- ...(input.WrappingAlgorithm !== undefined &&
3643
- input.WrappingAlgorithm !== null && { WrappingAlgorithm: input.WrappingAlgorithm }),
3644
- ...(input.WrappingKeySpec !== undefined &&
3645
- input.WrappingKeySpec !== null && { WrappingKeySpec: input.WrappingKeySpec }),
3655
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3656
+ ...(input.WrappingAlgorithm != null && { WrappingAlgorithm: input.WrappingAlgorithm }),
3657
+ ...(input.WrappingKeySpec != null && { WrappingKeySpec: input.WrappingKeySpec }),
3646
3658
  };
3647
3659
  };
3648
3660
  const serializeAws_json1_1GetPublicKeyRequest = (input, context) => {
3649
3661
  return {
3650
- ...(input.GrantTokens !== undefined &&
3651
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3652
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3662
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3663
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3653
3664
  };
3654
3665
  };
3655
3666
  const serializeAws_json1_1GrantConstraints = (input, context) => {
3656
3667
  return {
3657
- ...(input.EncryptionContextEquals !== undefined &&
3658
- input.EncryptionContextEquals !== null && {
3668
+ ...(input.EncryptionContextEquals != null && {
3659
3669
  EncryptionContextEquals: serializeAws_json1_1EncryptionContextType(input.EncryptionContextEquals, context),
3660
3670
  }),
3661
- ...(input.EncryptionContextSubset !== undefined &&
3662
- input.EncryptionContextSubset !== null && {
3671
+ ...(input.EncryptionContextSubset != null && {
3663
3672
  EncryptionContextSubset: serializeAws_json1_1EncryptionContextType(input.EncryptionContextSubset, context),
3664
3673
  }),
3665
3674
  };
@@ -3686,148 +3695,130 @@ const serializeAws_json1_1GrantTokenList = (input, context) => {
3686
3695
  };
3687
3696
  const serializeAws_json1_1ImportKeyMaterialRequest = (input, context) => {
3688
3697
  return {
3689
- ...(input.EncryptedKeyMaterial !== undefined &&
3690
- input.EncryptedKeyMaterial !== null && {
3698
+ ...(input.EncryptedKeyMaterial != null && {
3691
3699
  EncryptedKeyMaterial: context.base64Encoder(input.EncryptedKeyMaterial),
3692
3700
  }),
3693
- ...(input.ExpirationModel !== undefined &&
3694
- input.ExpirationModel !== null && { ExpirationModel: input.ExpirationModel }),
3695
- ...(input.ImportToken !== undefined &&
3696
- input.ImportToken !== null && { ImportToken: context.base64Encoder(input.ImportToken) }),
3697
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3698
- ...(input.ValidTo !== undefined &&
3699
- input.ValidTo !== null && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }),
3701
+ ...(input.ExpirationModel != null && { ExpirationModel: input.ExpirationModel }),
3702
+ ...(input.ImportToken != null && { ImportToken: context.base64Encoder(input.ImportToken) }),
3703
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3704
+ ...(input.ValidTo != null && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }),
3700
3705
  };
3701
3706
  };
3702
3707
  const serializeAws_json1_1ListAliasesRequest = (input, context) => {
3703
3708
  return {
3704
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3705
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3706
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3709
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3710
+ ...(input.Limit != null && { Limit: input.Limit }),
3711
+ ...(input.Marker != null && { Marker: input.Marker }),
3707
3712
  };
3708
3713
  };
3709
3714
  const serializeAws_json1_1ListGrantsRequest = (input, context) => {
3710
3715
  return {
3711
- ...(input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId }),
3712
- ...(input.GranteePrincipal !== undefined &&
3713
- input.GranteePrincipal !== null && { GranteePrincipal: input.GranteePrincipal }),
3714
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3715
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3716
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3716
+ ...(input.GrantId != null && { GrantId: input.GrantId }),
3717
+ ...(input.GranteePrincipal != null && { GranteePrincipal: input.GranteePrincipal }),
3718
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3719
+ ...(input.Limit != null && { Limit: input.Limit }),
3720
+ ...(input.Marker != null && { Marker: input.Marker }),
3717
3721
  };
3718
3722
  };
3719
3723
  const serializeAws_json1_1ListKeyPoliciesRequest = (input, context) => {
3720
3724
  return {
3721
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3722
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3723
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3725
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3726
+ ...(input.Limit != null && { Limit: input.Limit }),
3727
+ ...(input.Marker != null && { Marker: input.Marker }),
3724
3728
  };
3725
3729
  };
3726
3730
  const serializeAws_json1_1ListKeysRequest = (input, context) => {
3727
3731
  return {
3728
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3729
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3732
+ ...(input.Limit != null && { Limit: input.Limit }),
3733
+ ...(input.Marker != null && { Marker: input.Marker }),
3730
3734
  };
3731
3735
  };
3732
3736
  const serializeAws_json1_1ListResourceTagsRequest = (input, context) => {
3733
3737
  return {
3734
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3735
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3736
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3738
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3739
+ ...(input.Limit != null && { Limit: input.Limit }),
3740
+ ...(input.Marker != null && { Marker: input.Marker }),
3737
3741
  };
3738
3742
  };
3739
3743
  const serializeAws_json1_1ListRetirableGrantsRequest = (input, context) => {
3740
3744
  return {
3741
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
3742
- ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }),
3743
- ...(input.RetiringPrincipal !== undefined &&
3744
- input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }),
3745
+ ...(input.Limit != null && { Limit: input.Limit }),
3746
+ ...(input.Marker != null && { Marker: input.Marker }),
3747
+ ...(input.RetiringPrincipal != null && { RetiringPrincipal: input.RetiringPrincipal }),
3745
3748
  };
3746
3749
  };
3747
3750
  const serializeAws_json1_1PutKeyPolicyRequest = (input, context) => {
3748
3751
  return {
3749
- ...(input.BypassPolicyLockoutSafetyCheck !== undefined &&
3750
- input.BypassPolicyLockoutSafetyCheck !== null && {
3752
+ ...(input.BypassPolicyLockoutSafetyCheck != null && {
3751
3753
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
3752
3754
  }),
3753
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3754
- ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }),
3755
- ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }),
3755
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3756
+ ...(input.Policy != null && { Policy: input.Policy }),
3757
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
3756
3758
  };
3757
3759
  };
3758
3760
  const serializeAws_json1_1ReEncryptRequest = (input, context) => {
3759
3761
  return {
3760
- ...(input.CiphertextBlob !== undefined &&
3761
- input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }),
3762
- ...(input.DestinationEncryptionAlgorithm !== undefined &&
3763
- input.DestinationEncryptionAlgorithm !== null && {
3762
+ ...(input.CiphertextBlob != null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }),
3763
+ ...(input.DestinationEncryptionAlgorithm != null && {
3764
3764
  DestinationEncryptionAlgorithm: input.DestinationEncryptionAlgorithm,
3765
3765
  }),
3766
- ...(input.DestinationEncryptionContext !== undefined &&
3767
- input.DestinationEncryptionContext !== null && {
3766
+ ...(input.DestinationEncryptionContext != null && {
3768
3767
  DestinationEncryptionContext: serializeAws_json1_1EncryptionContextType(input.DestinationEncryptionContext, context),
3769
3768
  }),
3770
- ...(input.DestinationKeyId !== undefined &&
3771
- input.DestinationKeyId !== null && { DestinationKeyId: input.DestinationKeyId }),
3772
- ...(input.GrantTokens !== undefined &&
3773
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3774
- ...(input.SourceEncryptionAlgorithm !== undefined &&
3775
- input.SourceEncryptionAlgorithm !== null && { SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm }),
3776
- ...(input.SourceEncryptionContext !== undefined &&
3777
- input.SourceEncryptionContext !== null && {
3769
+ ...(input.DestinationKeyId != null && { DestinationKeyId: input.DestinationKeyId }),
3770
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3771
+ ...(input.SourceEncryptionAlgorithm != null && { SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm }),
3772
+ ...(input.SourceEncryptionContext != null && {
3778
3773
  SourceEncryptionContext: serializeAws_json1_1EncryptionContextType(input.SourceEncryptionContext, context),
3779
3774
  }),
3780
- ...(input.SourceKeyId !== undefined && input.SourceKeyId !== null && { SourceKeyId: input.SourceKeyId }),
3775
+ ...(input.SourceKeyId != null && { SourceKeyId: input.SourceKeyId }),
3781
3776
  };
3782
3777
  };
3783
3778
  const serializeAws_json1_1ReplicateKeyRequest = (input, context) => {
3784
3779
  return {
3785
- ...(input.BypassPolicyLockoutSafetyCheck !== undefined &&
3786
- input.BypassPolicyLockoutSafetyCheck !== null && {
3780
+ ...(input.BypassPolicyLockoutSafetyCheck != null && {
3787
3781
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
3788
3782
  }),
3789
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3790
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3791
- ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }),
3792
- ...(input.ReplicaRegion !== undefined && input.ReplicaRegion !== null && { ReplicaRegion: input.ReplicaRegion }),
3793
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3783
+ ...(input.Description != null && { Description: input.Description }),
3784
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3785
+ ...(input.Policy != null && { Policy: input.Policy }),
3786
+ ...(input.ReplicaRegion != null && { ReplicaRegion: input.ReplicaRegion }),
3787
+ ...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3794
3788
  };
3795
3789
  };
3796
3790
  const serializeAws_json1_1RetireGrantRequest = (input, context) => {
3797
3791
  return {
3798
- ...(input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId }),
3799
- ...(input.GrantToken !== undefined && input.GrantToken !== null && { GrantToken: input.GrantToken }),
3800
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3792
+ ...(input.GrantId != null && { GrantId: input.GrantId }),
3793
+ ...(input.GrantToken != null && { GrantToken: input.GrantToken }),
3794
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3801
3795
  };
3802
3796
  };
3803
3797
  const serializeAws_json1_1RevokeGrantRequest = (input, context) => {
3804
3798
  return {
3805
- ...(input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId }),
3806
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3799
+ ...(input.GrantId != null && { GrantId: input.GrantId }),
3800
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3807
3801
  };
3808
3802
  };
3809
3803
  const serializeAws_json1_1ScheduleKeyDeletionRequest = (input, context) => {
3810
3804
  return {
3811
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3812
- ...(input.PendingWindowInDays !== undefined &&
3813
- input.PendingWindowInDays !== null && { PendingWindowInDays: input.PendingWindowInDays }),
3805
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3806
+ ...(input.PendingWindowInDays != null && { PendingWindowInDays: input.PendingWindowInDays }),
3814
3807
  };
3815
3808
  };
3816
3809
  const serializeAws_json1_1SignRequest = (input, context) => {
3817
3810
  return {
3818
- ...(input.GrantTokens !== undefined &&
3819
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3820
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3821
- ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3822
- ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }),
3823
- ...(input.SigningAlgorithm !== undefined &&
3824
- input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }),
3811
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3812
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3813
+ ...(input.Message != null && { Message: context.base64Encoder(input.Message) }),
3814
+ ...(input.MessageType != null && { MessageType: input.MessageType }),
3815
+ ...(input.SigningAlgorithm != null && { SigningAlgorithm: input.SigningAlgorithm }),
3825
3816
  };
3826
3817
  };
3827
3818
  const serializeAws_json1_1Tag = (input, context) => {
3828
3819
  return {
3829
- ...(input.TagKey !== undefined && input.TagKey !== null && { TagKey: input.TagKey }),
3830
- ...(input.TagValue !== undefined && input.TagValue !== null && { TagValue: input.TagValue }),
3820
+ ...(input.TagKey != null && { TagKey: input.TagKey }),
3821
+ ...(input.TagValue != null && { TagValue: input.TagValue }),
3831
3822
  };
3832
3823
  };
3833
3824
  const serializeAws_json1_1TagKeyList = (input, context) => {
@@ -3852,68 +3843,59 @@ const serializeAws_json1_1TagList = (input, context) => {
3852
3843
  };
3853
3844
  const serializeAws_json1_1TagResourceRequest = (input, context) => {
3854
3845
  return {
3855
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3856
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3846
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3847
+ ...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
3857
3848
  };
3858
3849
  };
3859
3850
  const serializeAws_json1_1UntagResourceRequest = (input, context) => {
3860
3851
  return {
3861
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3862
- ...(input.TagKeys !== undefined &&
3863
- input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }),
3852
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3853
+ ...(input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }),
3864
3854
  };
3865
3855
  };
3866
3856
  const serializeAws_json1_1UpdateAliasRequest = (input, context) => {
3867
3857
  return {
3868
- ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }),
3869
- ...(input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }),
3858
+ ...(input.AliasName != null && { AliasName: input.AliasName }),
3859
+ ...(input.TargetKeyId != null && { TargetKeyId: input.TargetKeyId }),
3870
3860
  };
3871
3861
  };
3872
3862
  const serializeAws_json1_1UpdateCustomKeyStoreRequest = (input, context) => {
3873
3863
  return {
3874
- ...(input.CloudHsmClusterId !== undefined &&
3875
- input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId }),
3876
- ...(input.CustomKeyStoreId !== undefined &&
3877
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3878
- ...(input.KeyStorePassword !== undefined &&
3879
- input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword }),
3880
- ...(input.NewCustomKeyStoreName !== undefined &&
3881
- input.NewCustomKeyStoreName !== null && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }),
3864
+ ...(input.CloudHsmClusterId != null && { CloudHsmClusterId: input.CloudHsmClusterId }),
3865
+ ...(input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }),
3866
+ ...(input.KeyStorePassword != null && { KeyStorePassword: input.KeyStorePassword }),
3867
+ ...(input.NewCustomKeyStoreName != null && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }),
3882
3868
  };
3883
3869
  };
3884
3870
  const serializeAws_json1_1UpdateKeyDescriptionRequest = (input, context) => {
3885
3871
  return {
3886
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3887
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3872
+ ...(input.Description != null && { Description: input.Description }),
3873
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3888
3874
  };
3889
3875
  };
3890
3876
  const serializeAws_json1_1UpdatePrimaryRegionRequest = (input, context) => {
3891
3877
  return {
3892
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3893
- ...(input.PrimaryRegion !== undefined && input.PrimaryRegion !== null && { PrimaryRegion: input.PrimaryRegion }),
3878
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3879
+ ...(input.PrimaryRegion != null && { PrimaryRegion: input.PrimaryRegion }),
3894
3880
  };
3895
3881
  };
3896
3882
  const serializeAws_json1_1VerifyMacRequest = (input, context) => {
3897
3883
  return {
3898
- ...(input.GrantTokens !== undefined &&
3899
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3900
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3901
- ...(input.Mac !== undefined && input.Mac !== null && { Mac: context.base64Encoder(input.Mac) }),
3902
- ...(input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm }),
3903
- ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3884
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3885
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3886
+ ...(input.Mac != null && { Mac: context.base64Encoder(input.Mac) }),
3887
+ ...(input.MacAlgorithm != null && { MacAlgorithm: input.MacAlgorithm }),
3888
+ ...(input.Message != null && { Message: context.base64Encoder(input.Message) }),
3904
3889
  };
3905
3890
  };
3906
3891
  const serializeAws_json1_1VerifyRequest = (input, context) => {
3907
3892
  return {
3908
- ...(input.GrantTokens !== undefined &&
3909
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3910
- ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3911
- ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3912
- ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }),
3913
- ...(input.Signature !== undefined &&
3914
- input.Signature !== null && { Signature: context.base64Encoder(input.Signature) }),
3915
- ...(input.SigningAlgorithm !== undefined &&
3916
- input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }),
3893
+ ...(input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3894
+ ...(input.KeyId != null && { KeyId: input.KeyId }),
3895
+ ...(input.Message != null && { Message: context.base64Encoder(input.Message) }),
3896
+ ...(input.MessageType != null && { MessageType: input.MessageType }),
3897
+ ...(input.Signature != null && { Signature: context.base64Encoder(input.Signature) }),
3898
+ ...(input.SigningAlgorithm != null && { SigningAlgorithm: input.SigningAlgorithm }),
3917
3899
  };
3918
3900
  };
3919
3901
  const deserializeAws_json1_1AliasList = (output, context) => {
@@ -3931,10 +3913,10 @@ const deserializeAws_json1_1AliasListEntry = (output, context) => {
3931
3913
  return {
3932
3914
  AliasArn: (0, smithy_client_1.expectString)(output.AliasArn),
3933
3915
  AliasName: (0, smithy_client_1.expectString)(output.AliasName),
3934
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
3916
+ CreationDate: output.CreationDate != null
3935
3917
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
3936
3918
  : undefined,
3937
- LastUpdatedDate: output.LastUpdatedDate !== undefined && output.LastUpdatedDate !== null
3919
+ LastUpdatedDate: output.LastUpdatedDate != null
3938
3920
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastUpdatedDate)))
3939
3921
  : undefined,
3940
3922
  TargetKeyId: (0, smithy_client_1.expectString)(output.TargetKeyId),
@@ -3991,9 +3973,7 @@ const deserializeAws_json1_1CreateGrantResponse = (output, context) => {
3991
3973
  };
3992
3974
  const deserializeAws_json1_1CreateKeyResponse = (output, context) => {
3993
3975
  return {
3994
- KeyMetadata: output.KeyMetadata !== undefined && output.KeyMetadata !== null
3995
- ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context)
3996
- : undefined,
3976
+ KeyMetadata: output.KeyMetadata != null ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context) : undefined,
3997
3977
  };
3998
3978
  };
3999
3979
  const deserializeAws_json1_1CustomKeyStoreHasCMKsException = (output, context) => {
@@ -4032,7 +4012,7 @@ const deserializeAws_json1_1CustomKeyStoresListEntry = (output, context) => {
4032
4012
  CloudHsmClusterId: (0, smithy_client_1.expectString)(output.CloudHsmClusterId),
4033
4013
  ConnectionErrorCode: (0, smithy_client_1.expectString)(output.ConnectionErrorCode),
4034
4014
  ConnectionState: (0, smithy_client_1.expectString)(output.ConnectionState),
4035
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
4015
+ CreationDate: output.CreationDate != null
4036
4016
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
4037
4017
  : undefined,
4038
4018
  CustomKeyStoreId: (0, smithy_client_1.expectString)(output.CustomKeyStoreId),
@@ -4044,7 +4024,7 @@ const deserializeAws_json1_1DecryptResponse = (output, context) => {
4044
4024
  return {
4045
4025
  EncryptionAlgorithm: (0, smithy_client_1.expectString)(output.EncryptionAlgorithm),
4046
4026
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4047
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4027
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
4048
4028
  };
4049
4029
  };
4050
4030
  const deserializeAws_json1_1DeleteCustomKeyStoreResponse = (output, context) => {
@@ -4057,7 +4037,7 @@ const deserializeAws_json1_1DependencyTimeoutException = (output, context) => {
4057
4037
  };
4058
4038
  const deserializeAws_json1_1DescribeCustomKeyStoresResponse = (output, context) => {
4059
4039
  return {
4060
- CustomKeyStores: output.CustomKeyStores !== undefined && output.CustomKeyStores !== null
4040
+ CustomKeyStores: output.CustomKeyStores != null
4061
4041
  ? deserializeAws_json1_1CustomKeyStoresList(output.CustomKeyStores, context)
4062
4042
  : undefined,
4063
4043
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
@@ -4066,9 +4046,7 @@ const deserializeAws_json1_1DescribeCustomKeyStoresResponse = (output, context)
4066
4046
  };
4067
4047
  const deserializeAws_json1_1DescribeKeyResponse = (output, context) => {
4068
4048
  return {
4069
- KeyMetadata: output.KeyMetadata !== undefined && output.KeyMetadata !== null
4070
- ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context)
4071
- : undefined,
4049
+ KeyMetadata: output.KeyMetadata != null ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context) : undefined,
4072
4050
  };
4073
4051
  };
4074
4052
  const deserializeAws_json1_1DisabledException = (output, context) => {
@@ -4103,9 +4081,7 @@ const deserializeAws_json1_1EncryptionContextType = (output, context) => {
4103
4081
  };
4104
4082
  const deserializeAws_json1_1EncryptResponse = (output, context) => {
4105
4083
  return {
4106
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4107
- ? context.base64Decoder(output.CiphertextBlob)
4108
- : undefined,
4084
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4109
4085
  EncryptionAlgorithm: (0, smithy_client_1.expectString)(output.EncryptionAlgorithm),
4110
4086
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4111
4087
  };
@@ -4119,52 +4095,42 @@ const deserializeAws_json1_1GenerateDataKeyPairResponse = (output, context) => {
4119
4095
  return {
4120
4096
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4121
4097
  KeyPairSpec: (0, smithy_client_1.expectString)(output.KeyPairSpec),
4122
- PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob !== undefined && output.PrivateKeyCiphertextBlob !== null
4123
- ? context.base64Decoder(output.PrivateKeyCiphertextBlob)
4124
- : undefined,
4125
- PrivateKeyPlaintext: output.PrivateKeyPlaintext !== undefined && output.PrivateKeyPlaintext !== null
4126
- ? context.base64Decoder(output.PrivateKeyPlaintext)
4127
- : undefined,
4128
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4098
+ PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob != null ? context.base64Decoder(output.PrivateKeyCiphertextBlob) : undefined,
4099
+ PrivateKeyPlaintext: output.PrivateKeyPlaintext != null ? context.base64Decoder(output.PrivateKeyPlaintext) : undefined,
4100
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4129
4101
  };
4130
4102
  };
4131
4103
  const deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextResponse = (output, context) => {
4132
4104
  return {
4133
4105
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4134
4106
  KeyPairSpec: (0, smithy_client_1.expectString)(output.KeyPairSpec),
4135
- PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob !== undefined && output.PrivateKeyCiphertextBlob !== null
4136
- ? context.base64Decoder(output.PrivateKeyCiphertextBlob)
4137
- : undefined,
4138
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4107
+ PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob != null ? context.base64Decoder(output.PrivateKeyCiphertextBlob) : undefined,
4108
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4139
4109
  };
4140
4110
  };
4141
4111
  const deserializeAws_json1_1GenerateDataKeyResponse = (output, context) => {
4142
4112
  return {
4143
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4144
- ? context.base64Decoder(output.CiphertextBlob)
4145
- : undefined,
4113
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4146
4114
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4147
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4115
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
4148
4116
  };
4149
4117
  };
4150
4118
  const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextResponse = (output, context) => {
4151
4119
  return {
4152
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4153
- ? context.base64Decoder(output.CiphertextBlob)
4154
- : undefined,
4120
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4155
4121
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4156
4122
  };
4157
4123
  };
4158
4124
  const deserializeAws_json1_1GenerateMacResponse = (output, context) => {
4159
4125
  return {
4160
4126
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4161
- Mac: output.Mac !== undefined && output.Mac !== null ? context.base64Decoder(output.Mac) : undefined,
4127
+ Mac: output.Mac != null ? context.base64Decoder(output.Mac) : undefined,
4162
4128
  MacAlgorithm: (0, smithy_client_1.expectString)(output.MacAlgorithm),
4163
4129
  };
4164
4130
  };
4165
4131
  const deserializeAws_json1_1GenerateRandomResponse = (output, context) => {
4166
4132
  return {
4167
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4133
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
4168
4134
  };
4169
4135
  };
4170
4136
  const deserializeAws_json1_1GetKeyPolicyResponse = (output, context) => {
@@ -4179,37 +4145,35 @@ const deserializeAws_json1_1GetKeyRotationStatusResponse = (output, context) =>
4179
4145
  };
4180
4146
  const deserializeAws_json1_1GetParametersForImportResponse = (output, context) => {
4181
4147
  return {
4182
- ImportToken: output.ImportToken !== undefined && output.ImportToken !== null
4183
- ? context.base64Decoder(output.ImportToken)
4184
- : undefined,
4148
+ ImportToken: output.ImportToken != null ? context.base64Decoder(output.ImportToken) : undefined,
4185
4149
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4186
- ParametersValidTo: output.ParametersValidTo !== undefined && output.ParametersValidTo !== null
4150
+ ParametersValidTo: output.ParametersValidTo != null
4187
4151
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ParametersValidTo)))
4188
4152
  : undefined,
4189
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4153
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4190
4154
  };
4191
4155
  };
4192
4156
  const deserializeAws_json1_1GetPublicKeyResponse = (output, context) => {
4193
4157
  return {
4194
4158
  CustomerMasterKeySpec: (0, smithy_client_1.expectString)(output.CustomerMasterKeySpec),
4195
- EncryptionAlgorithms: output.EncryptionAlgorithms !== undefined && output.EncryptionAlgorithms !== null
4159
+ EncryptionAlgorithms: output.EncryptionAlgorithms != null
4196
4160
  ? deserializeAws_json1_1EncryptionAlgorithmSpecList(output.EncryptionAlgorithms, context)
4197
4161
  : undefined,
4198
4162
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4199
4163
  KeySpec: (0, smithy_client_1.expectString)(output.KeySpec),
4200
4164
  KeyUsage: (0, smithy_client_1.expectString)(output.KeyUsage),
4201
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4202
- SigningAlgorithms: output.SigningAlgorithms !== undefined && output.SigningAlgorithms !== null
4165
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4166
+ SigningAlgorithms: output.SigningAlgorithms != null
4203
4167
  ? deserializeAws_json1_1SigningAlgorithmSpecList(output.SigningAlgorithms, context)
4204
4168
  : undefined,
4205
4169
  };
4206
4170
  };
4207
4171
  const deserializeAws_json1_1GrantConstraints = (output, context) => {
4208
4172
  return {
4209
- EncryptionContextEquals: output.EncryptionContextEquals !== undefined && output.EncryptionContextEquals !== null
4173
+ EncryptionContextEquals: output.EncryptionContextEquals != null
4210
4174
  ? deserializeAws_json1_1EncryptionContextType(output.EncryptionContextEquals, context)
4211
4175
  : undefined,
4212
- EncryptionContextSubset: output.EncryptionContextSubset !== undefined && output.EncryptionContextSubset !== null
4176
+ EncryptionContextSubset: output.EncryptionContextSubset != null
4213
4177
  ? deserializeAws_json1_1EncryptionContextType(output.EncryptionContextSubset, context)
4214
4178
  : undefined,
4215
4179
  };
@@ -4227,10 +4191,8 @@ const deserializeAws_json1_1GrantList = (output, context) => {
4227
4191
  };
4228
4192
  const deserializeAws_json1_1GrantListEntry = (output, context) => {
4229
4193
  return {
4230
- Constraints: output.Constraints !== undefined && output.Constraints !== null
4231
- ? deserializeAws_json1_1GrantConstraints(output.Constraints, context)
4232
- : undefined,
4233
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
4194
+ Constraints: output.Constraints != null ? deserializeAws_json1_1GrantConstraints(output.Constraints, context) : undefined,
4195
+ CreationDate: output.CreationDate != null
4234
4196
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
4235
4197
  : undefined,
4236
4198
  GrantId: (0, smithy_client_1.expectString)(output.GrantId),
@@ -4238,9 +4200,7 @@ const deserializeAws_json1_1GrantListEntry = (output, context) => {
4238
4200
  IssuingAccount: (0, smithy_client_1.expectString)(output.IssuingAccount),
4239
4201
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4240
4202
  Name: (0, smithy_client_1.expectString)(output.Name),
4241
- Operations: output.Operations !== undefined && output.Operations !== null
4242
- ? deserializeAws_json1_1GrantOperationList(output.Operations, context)
4243
- : undefined,
4203
+ Operations: output.Operations != null ? deserializeAws_json1_1GrantOperationList(output.Operations, context) : undefined,
4244
4204
  RetiringPrincipal: (0, smithy_client_1.expectString)(output.RetiringPrincipal),
4245
4205
  };
4246
4206
  };
@@ -4335,17 +4295,17 @@ const deserializeAws_json1_1KeyMetadata = (output, context) => {
4335
4295
  AWSAccountId: (0, smithy_client_1.expectString)(output.AWSAccountId),
4336
4296
  Arn: (0, smithy_client_1.expectString)(output.Arn),
4337
4297
  CloudHsmClusterId: (0, smithy_client_1.expectString)(output.CloudHsmClusterId),
4338
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
4298
+ CreationDate: output.CreationDate != null
4339
4299
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
4340
4300
  : undefined,
4341
4301
  CustomKeyStoreId: (0, smithy_client_1.expectString)(output.CustomKeyStoreId),
4342
4302
  CustomerMasterKeySpec: (0, smithy_client_1.expectString)(output.CustomerMasterKeySpec),
4343
- DeletionDate: output.DeletionDate !== undefined && output.DeletionDate !== null
4303
+ DeletionDate: output.DeletionDate != null
4344
4304
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.DeletionDate)))
4345
4305
  : undefined,
4346
4306
  Description: (0, smithy_client_1.expectString)(output.Description),
4347
4307
  Enabled: (0, smithy_client_1.expectBoolean)(output.Enabled),
4348
- EncryptionAlgorithms: output.EncryptionAlgorithms !== undefined && output.EncryptionAlgorithms !== null
4308
+ EncryptionAlgorithms: output.EncryptionAlgorithms != null
4349
4309
  ? deserializeAws_json1_1EncryptionAlgorithmSpecList(output.EncryptionAlgorithms, context)
4350
4310
  : undefined,
4351
4311
  ExpirationModel: (0, smithy_client_1.expectString)(output.ExpirationModel),
@@ -4354,21 +4314,19 @@ const deserializeAws_json1_1KeyMetadata = (output, context) => {
4354
4314
  KeySpec: (0, smithy_client_1.expectString)(output.KeySpec),
4355
4315
  KeyState: (0, smithy_client_1.expectString)(output.KeyState),
4356
4316
  KeyUsage: (0, smithy_client_1.expectString)(output.KeyUsage),
4357
- MacAlgorithms: output.MacAlgorithms !== undefined && output.MacAlgorithms !== null
4317
+ MacAlgorithms: output.MacAlgorithms != null
4358
4318
  ? deserializeAws_json1_1MacAlgorithmSpecList(output.MacAlgorithms, context)
4359
4319
  : undefined,
4360
4320
  MultiRegion: (0, smithy_client_1.expectBoolean)(output.MultiRegion),
4361
- MultiRegionConfiguration: output.MultiRegionConfiguration !== undefined && output.MultiRegionConfiguration !== null
4321
+ MultiRegionConfiguration: output.MultiRegionConfiguration != null
4362
4322
  ? deserializeAws_json1_1MultiRegionConfiguration(output.MultiRegionConfiguration, context)
4363
4323
  : undefined,
4364
4324
  Origin: (0, smithy_client_1.expectString)(output.Origin),
4365
4325
  PendingDeletionWindowInDays: (0, smithy_client_1.expectInt32)(output.PendingDeletionWindowInDays),
4366
- SigningAlgorithms: output.SigningAlgorithms !== undefined && output.SigningAlgorithms !== null
4326
+ SigningAlgorithms: output.SigningAlgorithms != null
4367
4327
  ? deserializeAws_json1_1SigningAlgorithmSpecList(output.SigningAlgorithms, context)
4368
4328
  : undefined,
4369
- ValidTo: output.ValidTo !== undefined && output.ValidTo !== null
4370
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ValidTo)))
4371
- : undefined,
4329
+ ValidTo: output.ValidTo != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ValidTo))) : undefined,
4372
4330
  };
4373
4331
  };
4374
4332
  const deserializeAws_json1_1KeyUnavailableException = (output, context) => {
@@ -4403,18 +4361,14 @@ const deserializeAws_json1_1LimitExceededException = (output, context) => {
4403
4361
  };
4404
4362
  const deserializeAws_json1_1ListAliasesResponse = (output, context) => {
4405
4363
  return {
4406
- Aliases: output.Aliases !== undefined && output.Aliases !== null
4407
- ? deserializeAws_json1_1AliasList(output.Aliases, context)
4408
- : undefined,
4364
+ Aliases: output.Aliases != null ? deserializeAws_json1_1AliasList(output.Aliases, context) : undefined,
4409
4365
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
4410
4366
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4411
4367
  };
4412
4368
  };
4413
4369
  const deserializeAws_json1_1ListGrantsResponse = (output, context) => {
4414
4370
  return {
4415
- Grants: output.Grants !== undefined && output.Grants !== null
4416
- ? deserializeAws_json1_1GrantList(output.Grants, context)
4417
- : undefined,
4371
+ Grants: output.Grants != null ? deserializeAws_json1_1GrantList(output.Grants, context) : undefined,
4418
4372
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
4419
4373
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4420
4374
  };
@@ -4422,17 +4376,13 @@ const deserializeAws_json1_1ListGrantsResponse = (output, context) => {
4422
4376
  const deserializeAws_json1_1ListKeyPoliciesResponse = (output, context) => {
4423
4377
  return {
4424
4378
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
4425
- PolicyNames: output.PolicyNames !== undefined && output.PolicyNames !== null
4426
- ? deserializeAws_json1_1PolicyNameList(output.PolicyNames, context)
4427
- : undefined,
4379
+ PolicyNames: output.PolicyNames != null ? deserializeAws_json1_1PolicyNameList(output.PolicyNames, context) : undefined,
4428
4380
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4429
4381
  };
4430
4382
  };
4431
4383
  const deserializeAws_json1_1ListKeysResponse = (output, context) => {
4432
4384
  return {
4433
- Keys: output.Keys !== undefined && output.Keys !== null
4434
- ? deserializeAws_json1_1KeyList(output.Keys, context)
4435
- : undefined,
4385
+ Keys: output.Keys != null ? deserializeAws_json1_1KeyList(output.Keys, context) : undefined,
4436
4386
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
4437
4387
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4438
4388
  };
@@ -4440,9 +4390,7 @@ const deserializeAws_json1_1ListKeysResponse = (output, context) => {
4440
4390
  const deserializeAws_json1_1ListResourceTagsResponse = (output, context) => {
4441
4391
  return {
4442
4392
  NextMarker: (0, smithy_client_1.expectString)(output.NextMarker),
4443
- Tags: output.Tags !== undefined && output.Tags !== null
4444
- ? deserializeAws_json1_1TagList(output.Tags, context)
4445
- : undefined,
4393
+ Tags: output.Tags != null ? deserializeAws_json1_1TagList(output.Tags, context) : undefined,
4446
4394
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4447
4395
  };
4448
4396
  };
@@ -4465,12 +4413,8 @@ const deserializeAws_json1_1MalformedPolicyDocumentException = (output, context)
4465
4413
  const deserializeAws_json1_1MultiRegionConfiguration = (output, context) => {
4466
4414
  return {
4467
4415
  MultiRegionKeyType: (0, smithy_client_1.expectString)(output.MultiRegionKeyType),
4468
- PrimaryKey: output.PrimaryKey !== undefined && output.PrimaryKey !== null
4469
- ? deserializeAws_json1_1MultiRegionKey(output.PrimaryKey, context)
4470
- : undefined,
4471
- ReplicaKeys: output.ReplicaKeys !== undefined && output.ReplicaKeys !== null
4472
- ? deserializeAws_json1_1MultiRegionKeyList(output.ReplicaKeys, context)
4473
- : undefined,
4416
+ PrimaryKey: output.PrimaryKey != null ? deserializeAws_json1_1MultiRegionKey(output.PrimaryKey, context) : undefined,
4417
+ ReplicaKeys: output.ReplicaKeys != null ? deserializeAws_json1_1MultiRegionKeyList(output.ReplicaKeys, context) : undefined,
4474
4418
  };
4475
4419
  };
4476
4420
  const deserializeAws_json1_1MultiRegionKey = (output, context) => {
@@ -4508,9 +4452,7 @@ const deserializeAws_json1_1PolicyNameList = (output, context) => {
4508
4452
  };
4509
4453
  const deserializeAws_json1_1ReEncryptResponse = (output, context) => {
4510
4454
  return {
4511
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4512
- ? context.base64Decoder(output.CiphertextBlob)
4513
- : undefined,
4455
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4514
4456
  DestinationEncryptionAlgorithm: (0, smithy_client_1.expectString)(output.DestinationEncryptionAlgorithm),
4515
4457
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4516
4458
  SourceEncryptionAlgorithm: (0, smithy_client_1.expectString)(output.SourceEncryptionAlgorithm),
@@ -4519,18 +4461,16 @@ const deserializeAws_json1_1ReEncryptResponse = (output, context) => {
4519
4461
  };
4520
4462
  const deserializeAws_json1_1ReplicateKeyResponse = (output, context) => {
4521
4463
  return {
4522
- ReplicaKeyMetadata: output.ReplicaKeyMetadata !== undefined && output.ReplicaKeyMetadata !== null
4464
+ ReplicaKeyMetadata: output.ReplicaKeyMetadata != null
4523
4465
  ? deserializeAws_json1_1KeyMetadata(output.ReplicaKeyMetadata, context)
4524
4466
  : undefined,
4525
4467
  ReplicaPolicy: (0, smithy_client_1.expectString)(output.ReplicaPolicy),
4526
- ReplicaTags: output.ReplicaTags !== undefined && output.ReplicaTags !== null
4527
- ? deserializeAws_json1_1TagList(output.ReplicaTags, context)
4528
- : undefined,
4468
+ ReplicaTags: output.ReplicaTags != null ? deserializeAws_json1_1TagList(output.ReplicaTags, context) : undefined,
4529
4469
  };
4530
4470
  };
4531
4471
  const deserializeAws_json1_1ScheduleKeyDeletionResponse = (output, context) => {
4532
4472
  return {
4533
- DeletionDate: output.DeletionDate !== undefined && output.DeletionDate !== null
4473
+ DeletionDate: output.DeletionDate != null
4534
4474
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.DeletionDate)))
4535
4475
  : undefined,
4536
4476
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
@@ -4552,7 +4492,7 @@ const deserializeAws_json1_1SigningAlgorithmSpecList = (output, context) => {
4552
4492
  const deserializeAws_json1_1SignResponse = (output, context) => {
4553
4493
  return {
4554
4494
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4555
- Signature: output.Signature !== undefined && output.Signature !== null ? context.base64Decoder(output.Signature) : undefined,
4495
+ Signature: output.Signature != null ? context.base64Decoder(output.Signature) : undefined,
4556
4496
  SigningAlgorithm: (0, smithy_client_1.expectString)(output.SigningAlgorithm),
4557
4497
  };
4558
4498
  };
@@ -4662,5 +4602,4 @@ const loadRestJsonErrorCode = (output, data) => {
4662
4602
  if (data["__type"] !== undefined) {
4663
4603
  return sanitizeErrorCode(data["__type"]);
4664
4604
  }
4665
- return "";
4666
4605
  };