@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.
@@ -572,7 +572,7 @@ export var deserializeAws_json1_1CancelKeyDeletionCommand = function (output, co
572
572
  });
573
573
  }); };
574
574
  var deserializeAws_json1_1CancelKeyDeletionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
575
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
575
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
576
576
  var _c;
577
577
  return __generator(this, function (_d) {
578
578
  switch (_d.label) {
@@ -582,7 +582,6 @@ var deserializeAws_json1_1CancelKeyDeletionCommandError = function (output, cont
582
582
  return [4, parseBody(output.body, context)];
583
583
  case 1:
584
584
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
585
- errorCode = "UnknownError";
586
585
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
587
586
  _b = errorCode;
588
587
  switch (_b) {
@@ -610,10 +609,12 @@ var deserializeAws_json1_1CancelKeyDeletionCommandError = function (output, cont
610
609
  case 11: throw _d.sent();
611
610
  case 12:
612
611
  parsedBody = parsedOutput.body;
612
+ $metadata = deserializeMetadata(output);
613
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
613
614
  response = new __BaseException({
614
- name: parsedBody.code || parsedBody.Code || errorCode,
615
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
615
616
  $fault: "client",
616
- $metadata: deserializeMetadata(output),
617
+ $metadata: $metadata,
617
618
  });
618
619
  throw __decorateServiceException(response, parsedBody);
619
620
  }
@@ -638,7 +639,7 @@ export var deserializeAws_json1_1ConnectCustomKeyStoreCommand = function (output
638
639
  });
639
640
  }); };
640
641
  var deserializeAws_json1_1ConnectCustomKeyStoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
641
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
642
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
642
643
  var _c;
643
644
  return __generator(this, function (_d) {
644
645
  switch (_d.label) {
@@ -648,7 +649,6 @@ var deserializeAws_json1_1ConnectCustomKeyStoreCommandError = function (output,
648
649
  return [4, parseBody(output.body, context)];
649
650
  case 1:
650
651
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
651
- errorCode = "UnknownError";
652
652
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
653
653
  _b = errorCode;
654
654
  switch (_b) {
@@ -676,10 +676,12 @@ var deserializeAws_json1_1ConnectCustomKeyStoreCommandError = function (output,
676
676
  case 11: throw _d.sent();
677
677
  case 12:
678
678
  parsedBody = parsedOutput.body;
679
+ $metadata = deserializeMetadata(output);
680
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
679
681
  response = new __BaseException({
680
- name: parsedBody.code || parsedBody.Code || errorCode,
682
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
681
683
  $fault: "client",
682
- $metadata: deserializeMetadata(output),
684
+ $metadata: $metadata,
683
685
  });
684
686
  throw __decorateServiceException(response, parsedBody);
685
687
  }
@@ -704,7 +706,7 @@ export var deserializeAws_json1_1CreateAliasCommand = function (output, context)
704
706
  });
705
707
  }); };
706
708
  var deserializeAws_json1_1CreateAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
707
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
709
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
708
710
  var _c;
709
711
  return __generator(this, function (_d) {
710
712
  switch (_d.label) {
@@ -714,7 +716,6 @@ var deserializeAws_json1_1CreateAliasCommandError = function (output, context) {
714
716
  return [4, parseBody(output.body, context)];
715
717
  case 1:
716
718
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
717
- errorCode = "UnknownError";
718
719
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
719
720
  _b = errorCode;
720
721
  switch (_b) {
@@ -750,10 +751,12 @@ var deserializeAws_json1_1CreateAliasCommandError = function (output, context) {
750
751
  case 15: throw _d.sent();
751
752
  case 16:
752
753
  parsedBody = parsedOutput.body;
754
+ $metadata = deserializeMetadata(output);
755
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
753
756
  response = new __BaseException({
754
- name: parsedBody.code || parsedBody.Code || errorCode,
757
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
755
758
  $fault: "client",
756
- $metadata: deserializeMetadata(output),
759
+ $metadata: $metadata,
757
760
  });
758
761
  throw __decorateServiceException(response, parsedBody);
759
762
  }
@@ -778,7 +781,7 @@ export var deserializeAws_json1_1CreateCustomKeyStoreCommand = function (output,
778
781
  });
779
782
  }); };
780
783
  var deserializeAws_json1_1CreateCustomKeyStoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
781
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
784
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
782
785
  var _c;
783
786
  return __generator(this, function (_d) {
784
787
  switch (_d.label) {
@@ -788,7 +791,6 @@ var deserializeAws_json1_1CreateCustomKeyStoreCommandError = function (output, c
788
791
  return [4, parseBody(output.body, context)];
789
792
  case 1:
790
793
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
791
- errorCode = "UnknownError";
792
794
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
793
795
  _b = errorCode;
794
796
  switch (_b) {
@@ -824,10 +826,12 @@ var deserializeAws_json1_1CreateCustomKeyStoreCommandError = function (output, c
824
826
  case 15: throw _d.sent();
825
827
  case 16:
826
828
  parsedBody = parsedOutput.body;
829
+ $metadata = deserializeMetadata(output);
830
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
827
831
  response = new __BaseException({
828
- name: parsedBody.code || parsedBody.Code || errorCode,
832
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
829
833
  $fault: "client",
830
- $metadata: deserializeMetadata(output),
834
+ $metadata: $metadata,
831
835
  });
832
836
  throw __decorateServiceException(response, parsedBody);
833
837
  }
@@ -852,7 +856,7 @@ export var deserializeAws_json1_1CreateGrantCommand = function (output, context)
852
856
  });
853
857
  }); };
854
858
  var deserializeAws_json1_1CreateGrantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
855
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
859
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
856
860
  var _c;
857
861
  return __generator(this, function (_d) {
858
862
  switch (_d.label) {
@@ -862,7 +866,6 @@ var deserializeAws_json1_1CreateGrantCommandError = function (output, context) {
862
866
  return [4, parseBody(output.body, context)];
863
867
  case 1:
864
868
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
865
- errorCode = "UnknownError";
866
869
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
867
870
  _b = errorCode;
868
871
  switch (_b) {
@@ -902,10 +905,12 @@ var deserializeAws_json1_1CreateGrantCommandError = function (output, context) {
902
905
  case 17: throw _d.sent();
903
906
  case 18:
904
907
  parsedBody = parsedOutput.body;
908
+ $metadata = deserializeMetadata(output);
909
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
905
910
  response = new __BaseException({
906
- name: parsedBody.code || parsedBody.Code || errorCode,
911
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
907
912
  $fault: "client",
908
- $metadata: deserializeMetadata(output),
913
+ $metadata: $metadata,
909
914
  });
910
915
  throw __decorateServiceException(response, parsedBody);
911
916
  }
@@ -930,7 +935,7 @@ export var deserializeAws_json1_1CreateKeyCommand = function (output, context) {
930
935
  });
931
936
  }); };
932
937
  var deserializeAws_json1_1CreateKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
933
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
938
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
934
939
  var _c;
935
940
  return __generator(this, function (_d) {
936
941
  switch (_d.label) {
@@ -940,7 +945,6 @@ var deserializeAws_json1_1CreateKeyCommandError = function (output, context) { r
940
945
  return [4, parseBody(output.body, context)];
941
946
  case 1:
942
947
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
943
- errorCode = "UnknownError";
944
948
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
945
949
  _b = errorCode;
946
950
  switch (_b) {
@@ -988,10 +992,12 @@ var deserializeAws_json1_1CreateKeyCommandError = function (output, context) { r
988
992
  case 21: throw _d.sent();
989
993
  case 22:
990
994
  parsedBody = parsedOutput.body;
995
+ $metadata = deserializeMetadata(output);
996
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
991
997
  response = new __BaseException({
992
- name: parsedBody.code || parsedBody.Code || errorCode,
998
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
993
999
  $fault: "client",
994
- $metadata: deserializeMetadata(output),
1000
+ $metadata: $metadata,
995
1001
  });
996
1002
  throw __decorateServiceException(response, parsedBody);
997
1003
  }
@@ -1016,7 +1022,7 @@ export var deserializeAws_json1_1DecryptCommand = function (output, context) { r
1016
1022
  });
1017
1023
  }); };
1018
1024
  var deserializeAws_json1_1DecryptCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1019
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1025
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1020
1026
  var _c;
1021
1027
  return __generator(this, function (_d) {
1022
1028
  switch (_d.label) {
@@ -1026,7 +1032,6 @@ var deserializeAws_json1_1DecryptCommandError = function (output, context) { ret
1026
1032
  return [4, parseBody(output.body, context)];
1027
1033
  case 1:
1028
1034
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1029
- errorCode = "UnknownError";
1030
1035
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1031
1036
  _b = errorCode;
1032
1037
  switch (_b) {
@@ -1074,10 +1079,12 @@ var deserializeAws_json1_1DecryptCommandError = function (output, context) { ret
1074
1079
  case 21: throw _d.sent();
1075
1080
  case 22:
1076
1081
  parsedBody = parsedOutput.body;
1082
+ $metadata = deserializeMetadata(output);
1083
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1077
1084
  response = new __BaseException({
1078
- name: parsedBody.code || parsedBody.Code || errorCode,
1085
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1079
1086
  $fault: "client",
1080
- $metadata: deserializeMetadata(output),
1087
+ $metadata: $metadata,
1081
1088
  });
1082
1089
  throw __decorateServiceException(response, parsedBody);
1083
1090
  }
@@ -1102,7 +1109,7 @@ export var deserializeAws_json1_1DeleteAliasCommand = function (output, context)
1102
1109
  });
1103
1110
  }); };
1104
1111
  var deserializeAws_json1_1DeleteAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1105
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1112
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1106
1113
  var _c;
1107
1114
  return __generator(this, function (_d) {
1108
1115
  switch (_d.label) {
@@ -1112,7 +1119,6 @@ var deserializeAws_json1_1DeleteAliasCommandError = function (output, context) {
1112
1119
  return [4, parseBody(output.body, context)];
1113
1120
  case 1:
1114
1121
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1115
- errorCode = "UnknownError";
1116
1122
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1117
1123
  _b = errorCode;
1118
1124
  switch (_b) {
@@ -1136,10 +1142,12 @@ var deserializeAws_json1_1DeleteAliasCommandError = function (output, context) {
1136
1142
  case 9: throw _d.sent();
1137
1143
  case 10:
1138
1144
  parsedBody = parsedOutput.body;
1145
+ $metadata = deserializeMetadata(output);
1146
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1139
1147
  response = new __BaseException({
1140
- name: parsedBody.code || parsedBody.Code || errorCode,
1148
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1141
1149
  $fault: "client",
1142
- $metadata: deserializeMetadata(output),
1150
+ $metadata: $metadata,
1143
1151
  });
1144
1152
  throw __decorateServiceException(response, parsedBody);
1145
1153
  }
@@ -1164,7 +1172,7 @@ export var deserializeAws_json1_1DeleteCustomKeyStoreCommand = function (output,
1164
1172
  });
1165
1173
  }); };
1166
1174
  var deserializeAws_json1_1DeleteCustomKeyStoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1167
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1175
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1168
1176
  var _c;
1169
1177
  return __generator(this, function (_d) {
1170
1178
  switch (_d.label) {
@@ -1174,7 +1182,6 @@ var deserializeAws_json1_1DeleteCustomKeyStoreCommandError = function (output, c
1174
1182
  return [4, parseBody(output.body, context)];
1175
1183
  case 1:
1176
1184
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1177
- errorCode = "UnknownError";
1178
1185
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
1186
  _b = errorCode;
1180
1187
  switch (_b) {
@@ -1198,10 +1205,12 @@ var deserializeAws_json1_1DeleteCustomKeyStoreCommandError = function (output, c
1198
1205
  case 9: throw _d.sent();
1199
1206
  case 10:
1200
1207
  parsedBody = parsedOutput.body;
1208
+ $metadata = deserializeMetadata(output);
1209
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1201
1210
  response = new __BaseException({
1202
- name: parsedBody.code || parsedBody.Code || errorCode,
1211
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1203
1212
  $fault: "client",
1204
- $metadata: deserializeMetadata(output),
1213
+ $metadata: $metadata,
1205
1214
  });
1206
1215
  throw __decorateServiceException(response, parsedBody);
1207
1216
  }
@@ -1226,7 +1235,7 @@ export var deserializeAws_json1_1DeleteImportedKeyMaterialCommand = function (ou
1226
1235
  });
1227
1236
  }); };
1228
1237
  var deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1229
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1238
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1230
1239
  var _c;
1231
1240
  return __generator(this, function (_d) {
1232
1241
  switch (_d.label) {
@@ -1236,7 +1245,6 @@ var deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = function (outp
1236
1245
  return [4, parseBody(output.body, context)];
1237
1246
  case 1:
1238
1247
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1239
- errorCode = "UnknownError";
1240
1248
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1241
1249
  _b = errorCode;
1242
1250
  switch (_b) {
@@ -1268,10 +1276,12 @@ var deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = function (outp
1268
1276
  case 13: throw _d.sent();
1269
1277
  case 14:
1270
1278
  parsedBody = parsedOutput.body;
1279
+ $metadata = deserializeMetadata(output);
1280
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1271
1281
  response = new __BaseException({
1272
- name: parsedBody.code || parsedBody.Code || errorCode,
1282
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1273
1283
  $fault: "client",
1274
- $metadata: deserializeMetadata(output),
1284
+ $metadata: $metadata,
1275
1285
  });
1276
1286
  throw __decorateServiceException(response, parsedBody);
1277
1287
  }
@@ -1296,7 +1306,7 @@ export var deserializeAws_json1_1DescribeCustomKeyStoresCommand = function (outp
1296
1306
  });
1297
1307
  }); };
1298
1308
  var deserializeAws_json1_1DescribeCustomKeyStoresCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1299
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1309
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1300
1310
  var _c;
1301
1311
  return __generator(this, function (_d) {
1302
1312
  switch (_d.label) {
@@ -1306,7 +1316,6 @@ var deserializeAws_json1_1DescribeCustomKeyStoresCommandError = function (output
1306
1316
  return [4, parseBody(output.body, context)];
1307
1317
  case 1:
1308
1318
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1309
- errorCode = "UnknownError";
1310
1319
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1311
1320
  _b = errorCode;
1312
1321
  switch (_b) {
@@ -1326,10 +1335,12 @@ var deserializeAws_json1_1DescribeCustomKeyStoresCommandError = function (output
1326
1335
  case 7: throw _d.sent();
1327
1336
  case 8:
1328
1337
  parsedBody = parsedOutput.body;
1338
+ $metadata = deserializeMetadata(output);
1339
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1329
1340
  response = new __BaseException({
1330
- name: parsedBody.code || parsedBody.Code || errorCode,
1341
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1331
1342
  $fault: "client",
1332
- $metadata: deserializeMetadata(output),
1343
+ $metadata: $metadata,
1333
1344
  });
1334
1345
  throw __decorateServiceException(response, parsedBody);
1335
1346
  }
@@ -1354,7 +1365,7 @@ export var deserializeAws_json1_1DescribeKeyCommand = function (output, context)
1354
1365
  });
1355
1366
  }); };
1356
1367
  var deserializeAws_json1_1DescribeKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1357
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1368
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1358
1369
  var _c;
1359
1370
  return __generator(this, function (_d) {
1360
1371
  switch (_d.label) {
@@ -1364,7 +1375,6 @@ var deserializeAws_json1_1DescribeKeyCommandError = function (output, context) {
1364
1375
  return [4, parseBody(output.body, context)];
1365
1376
  case 1:
1366
1377
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1367
- errorCode = "UnknownError";
1368
1378
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1369
1379
  _b = errorCode;
1370
1380
  switch (_b) {
@@ -1388,10 +1398,12 @@ var deserializeAws_json1_1DescribeKeyCommandError = function (output, context) {
1388
1398
  case 9: throw _d.sent();
1389
1399
  case 10:
1390
1400
  parsedBody = parsedOutput.body;
1401
+ $metadata = deserializeMetadata(output);
1402
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1391
1403
  response = new __BaseException({
1392
- name: parsedBody.code || parsedBody.Code || errorCode,
1404
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1393
1405
  $fault: "client",
1394
- $metadata: deserializeMetadata(output),
1406
+ $metadata: $metadata,
1395
1407
  });
1396
1408
  throw __decorateServiceException(response, parsedBody);
1397
1409
  }
@@ -1416,7 +1428,7 @@ export var deserializeAws_json1_1DisableKeyCommand = function (output, context)
1416
1428
  });
1417
1429
  }); };
1418
1430
  var deserializeAws_json1_1DisableKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1419
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1431
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1420
1432
  var _c;
1421
1433
  return __generator(this, function (_d) {
1422
1434
  switch (_d.label) {
@@ -1426,7 +1438,6 @@ var deserializeAws_json1_1DisableKeyCommandError = function (output, context) {
1426
1438
  return [4, parseBody(output.body, context)];
1427
1439
  case 1:
1428
1440
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1429
- errorCode = "UnknownError";
1430
1441
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1431
1442
  _b = errorCode;
1432
1443
  switch (_b) {
@@ -1454,10 +1465,12 @@ var deserializeAws_json1_1DisableKeyCommandError = function (output, context) {
1454
1465
  case 11: throw _d.sent();
1455
1466
  case 12:
1456
1467
  parsedBody = parsedOutput.body;
1468
+ $metadata = deserializeMetadata(output);
1469
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1457
1470
  response = new __BaseException({
1458
- name: parsedBody.code || parsedBody.Code || errorCode,
1471
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1459
1472
  $fault: "client",
1460
- $metadata: deserializeMetadata(output),
1473
+ $metadata: $metadata,
1461
1474
  });
1462
1475
  throw __decorateServiceException(response, parsedBody);
1463
1476
  }
@@ -1482,7 +1495,7 @@ export var deserializeAws_json1_1DisableKeyRotationCommand = function (output, c
1482
1495
  });
1483
1496
  }); };
1484
1497
  var deserializeAws_json1_1DisableKeyRotationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1485
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1498
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1486
1499
  var _c;
1487
1500
  return __generator(this, function (_d) {
1488
1501
  switch (_d.label) {
@@ -1492,7 +1505,6 @@ var deserializeAws_json1_1DisableKeyRotationCommandError = function (output, con
1492
1505
  return [4, parseBody(output.body, context)];
1493
1506
  case 1:
1494
1507
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1495
- errorCode = "UnknownError";
1496
1508
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1497
1509
  _b = errorCode;
1498
1510
  switch (_b) {
@@ -1528,10 +1540,12 @@ var deserializeAws_json1_1DisableKeyRotationCommandError = function (output, con
1528
1540
  case 15: throw _d.sent();
1529
1541
  case 16:
1530
1542
  parsedBody = parsedOutput.body;
1543
+ $metadata = deserializeMetadata(output);
1544
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1531
1545
  response = new __BaseException({
1532
- name: parsedBody.code || parsedBody.Code || errorCode,
1546
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1533
1547
  $fault: "client",
1534
- $metadata: deserializeMetadata(output),
1548
+ $metadata: $metadata,
1535
1549
  });
1536
1550
  throw __decorateServiceException(response, parsedBody);
1537
1551
  }
@@ -1556,7 +1570,7 @@ export var deserializeAws_json1_1DisconnectCustomKeyStoreCommand = function (out
1556
1570
  });
1557
1571
  }); };
1558
1572
  var deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1559
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1573
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1560
1574
  var _c;
1561
1575
  return __generator(this, function (_d) {
1562
1576
  switch (_d.label) {
@@ -1566,7 +1580,6 @@ var deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = function (outpu
1566
1580
  return [4, parseBody(output.body, context)];
1567
1581
  case 1:
1568
1582
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1569
- errorCode = "UnknownError";
1570
1583
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1571
1584
  _b = errorCode;
1572
1585
  switch (_b) {
@@ -1586,10 +1599,12 @@ var deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = function (outpu
1586
1599
  case 7: throw _d.sent();
1587
1600
  case 8:
1588
1601
  parsedBody = parsedOutput.body;
1602
+ $metadata = deserializeMetadata(output);
1603
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1589
1604
  response = new __BaseException({
1590
- name: parsedBody.code || parsedBody.Code || errorCode,
1605
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1591
1606
  $fault: "client",
1592
- $metadata: deserializeMetadata(output),
1607
+ $metadata: $metadata,
1593
1608
  });
1594
1609
  throw __decorateServiceException(response, parsedBody);
1595
1610
  }
@@ -1614,7 +1629,7 @@ export var deserializeAws_json1_1EnableKeyCommand = function (output, context) {
1614
1629
  });
1615
1630
  }); };
1616
1631
  var deserializeAws_json1_1EnableKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1617
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1632
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1618
1633
  var _c;
1619
1634
  return __generator(this, function (_d) {
1620
1635
  switch (_d.label) {
@@ -1624,7 +1639,6 @@ var deserializeAws_json1_1EnableKeyCommandError = function (output, context) { r
1624
1639
  return [4, parseBody(output.body, context)];
1625
1640
  case 1:
1626
1641
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1627
- errorCode = "UnknownError";
1628
1642
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1629
1643
  _b = errorCode;
1630
1644
  switch (_b) {
@@ -1656,10 +1670,12 @@ var deserializeAws_json1_1EnableKeyCommandError = function (output, context) { r
1656
1670
  case 13: throw _d.sent();
1657
1671
  case 14:
1658
1672
  parsedBody = parsedOutput.body;
1673
+ $metadata = deserializeMetadata(output);
1674
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1659
1675
  response = new __BaseException({
1660
- name: parsedBody.code || parsedBody.Code || errorCode,
1676
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1661
1677
  $fault: "client",
1662
- $metadata: deserializeMetadata(output),
1678
+ $metadata: $metadata,
1663
1679
  });
1664
1680
  throw __decorateServiceException(response, parsedBody);
1665
1681
  }
@@ -1684,7 +1700,7 @@ export var deserializeAws_json1_1EnableKeyRotationCommand = function (output, co
1684
1700
  });
1685
1701
  }); };
1686
1702
  var deserializeAws_json1_1EnableKeyRotationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1687
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1703
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1688
1704
  var _c;
1689
1705
  return __generator(this, function (_d) {
1690
1706
  switch (_d.label) {
@@ -1694,7 +1710,6 @@ var deserializeAws_json1_1EnableKeyRotationCommandError = function (output, cont
1694
1710
  return [4, parseBody(output.body, context)];
1695
1711
  case 1:
1696
1712
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1697
- errorCode = "UnknownError";
1698
1713
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1699
1714
  _b = errorCode;
1700
1715
  switch (_b) {
@@ -1730,10 +1745,12 @@ var deserializeAws_json1_1EnableKeyRotationCommandError = function (output, cont
1730
1745
  case 15: throw _d.sent();
1731
1746
  case 16:
1732
1747
  parsedBody = parsedOutput.body;
1748
+ $metadata = deserializeMetadata(output);
1749
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1733
1750
  response = new __BaseException({
1734
- name: parsedBody.code || parsedBody.Code || errorCode,
1751
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1735
1752
  $fault: "client",
1736
- $metadata: deserializeMetadata(output),
1753
+ $metadata: $metadata,
1737
1754
  });
1738
1755
  throw __decorateServiceException(response, parsedBody);
1739
1756
  }
@@ -1758,7 +1775,7 @@ export var deserializeAws_json1_1EncryptCommand = function (output, context) { r
1758
1775
  });
1759
1776
  }); };
1760
1777
  var deserializeAws_json1_1EncryptCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1761
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1778
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1762
1779
  var _c;
1763
1780
  return __generator(this, function (_d) {
1764
1781
  switch (_d.label) {
@@ -1768,7 +1785,6 @@ var deserializeAws_json1_1EncryptCommandError = function (output, context) { ret
1768
1785
  return [4, parseBody(output.body, context)];
1769
1786
  case 1:
1770
1787
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1771
- errorCode = "UnknownError";
1772
1788
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1773
1789
  _b = errorCode;
1774
1790
  switch (_b) {
@@ -1808,10 +1824,12 @@ var deserializeAws_json1_1EncryptCommandError = function (output, context) { ret
1808
1824
  case 17: throw _d.sent();
1809
1825
  case 18:
1810
1826
  parsedBody = parsedOutput.body;
1827
+ $metadata = deserializeMetadata(output);
1828
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1811
1829
  response = new __BaseException({
1812
- name: parsedBody.code || parsedBody.Code || errorCode,
1830
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1813
1831
  $fault: "client",
1814
- $metadata: deserializeMetadata(output),
1832
+ $metadata: $metadata,
1815
1833
  });
1816
1834
  throw __decorateServiceException(response, parsedBody);
1817
1835
  }
@@ -1836,7 +1854,7 @@ export var deserializeAws_json1_1GenerateDataKeyCommand = function (output, cont
1836
1854
  });
1837
1855
  }); };
1838
1856
  var deserializeAws_json1_1GenerateDataKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1839
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1857
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1840
1858
  var _c;
1841
1859
  return __generator(this, function (_d) {
1842
1860
  switch (_d.label) {
@@ -1846,7 +1864,6 @@ var deserializeAws_json1_1GenerateDataKeyCommandError = function (output, contex
1846
1864
  return [4, parseBody(output.body, context)];
1847
1865
  case 1:
1848
1866
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1849
- errorCode = "UnknownError";
1850
1867
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1851
1868
  _b = errorCode;
1852
1869
  switch (_b) {
@@ -1886,10 +1903,12 @@ var deserializeAws_json1_1GenerateDataKeyCommandError = function (output, contex
1886
1903
  case 17: throw _d.sent();
1887
1904
  case 18:
1888
1905
  parsedBody = parsedOutput.body;
1906
+ $metadata = deserializeMetadata(output);
1907
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1889
1908
  response = new __BaseException({
1890
- name: parsedBody.code || parsedBody.Code || errorCode,
1909
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1891
1910
  $fault: "client",
1892
- $metadata: deserializeMetadata(output),
1911
+ $metadata: $metadata,
1893
1912
  });
1894
1913
  throw __decorateServiceException(response, parsedBody);
1895
1914
  }
@@ -1914,7 +1933,7 @@ export var deserializeAws_json1_1GenerateDataKeyPairCommand = function (output,
1914
1933
  });
1915
1934
  }); };
1916
1935
  var deserializeAws_json1_1GenerateDataKeyPairCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1917
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
1936
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1918
1937
  var _c;
1919
1938
  return __generator(this, function (_d) {
1920
1939
  switch (_d.label) {
@@ -1924,7 +1943,6 @@ var deserializeAws_json1_1GenerateDataKeyPairCommandError = function (output, co
1924
1943
  return [4, parseBody(output.body, context)];
1925
1944
  case 1:
1926
1945
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1927
- errorCode = "UnknownError";
1928
1946
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1929
1947
  _b = errorCode;
1930
1948
  switch (_b) {
@@ -1968,10 +1986,12 @@ var deserializeAws_json1_1GenerateDataKeyPairCommandError = function (output, co
1968
1986
  case 19: throw _d.sent();
1969
1987
  case 20:
1970
1988
  parsedBody = parsedOutput.body;
1989
+ $metadata = deserializeMetadata(output);
1990
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1971
1991
  response = new __BaseException({
1972
- name: parsedBody.code || parsedBody.Code || errorCode,
1992
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1973
1993
  $fault: "client",
1974
- $metadata: deserializeMetadata(output),
1994
+ $metadata: $metadata,
1975
1995
  });
1976
1996
  throw __decorateServiceException(response, parsedBody);
1977
1997
  }
@@ -1996,7 +2016,7 @@ export var deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = fu
1996
2016
  });
1997
2017
  }); };
1998
2018
  var deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1999
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2019
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2000
2020
  var _c;
2001
2021
  return __generator(this, function (_d) {
2002
2022
  switch (_d.label) {
@@ -2006,7 +2026,6 @@ var deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = func
2006
2026
  return [4, parseBody(output.body, context)];
2007
2027
  case 1:
2008
2028
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2009
- errorCode = "UnknownError";
2010
2029
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2011
2030
  _b = errorCode;
2012
2031
  switch (_b) {
@@ -2050,10 +2069,12 @@ var deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = func
2050
2069
  case 19: throw _d.sent();
2051
2070
  case 20:
2052
2071
  parsedBody = parsedOutput.body;
2072
+ $metadata = deserializeMetadata(output);
2073
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2053
2074
  response = new __BaseException({
2054
- name: parsedBody.code || parsedBody.Code || errorCode,
2075
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2055
2076
  $fault: "client",
2056
- $metadata: deserializeMetadata(output),
2077
+ $metadata: $metadata,
2057
2078
  });
2058
2079
  throw __decorateServiceException(response, parsedBody);
2059
2080
  }
@@ -2078,7 +2099,7 @@ export var deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = functi
2078
2099
  });
2079
2100
  }); };
2080
2101
  var deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2081
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2102
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2082
2103
  var _c;
2083
2104
  return __generator(this, function (_d) {
2084
2105
  switch (_d.label) {
@@ -2088,7 +2109,6 @@ var deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = function
2088
2109
  return [4, parseBody(output.body, context)];
2089
2110
  case 1:
2090
2111
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2091
- errorCode = "UnknownError";
2092
2112
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2093
2113
  _b = errorCode;
2094
2114
  switch (_b) {
@@ -2128,10 +2148,12 @@ var deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = function
2128
2148
  case 17: throw _d.sent();
2129
2149
  case 18:
2130
2150
  parsedBody = parsedOutput.body;
2151
+ $metadata = deserializeMetadata(output);
2152
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2131
2153
  response = new __BaseException({
2132
- name: parsedBody.code || parsedBody.Code || errorCode,
2154
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2133
2155
  $fault: "client",
2134
- $metadata: deserializeMetadata(output),
2156
+ $metadata: $metadata,
2135
2157
  });
2136
2158
  throw __decorateServiceException(response, parsedBody);
2137
2159
  }
@@ -2156,7 +2178,7 @@ export var deserializeAws_json1_1GenerateMacCommand = function (output, context)
2156
2178
  });
2157
2179
  }); };
2158
2180
  var deserializeAws_json1_1GenerateMacCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2159
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2181
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2160
2182
  var _c;
2161
2183
  return __generator(this, function (_d) {
2162
2184
  switch (_d.label) {
@@ -2166,7 +2188,6 @@ var deserializeAws_json1_1GenerateMacCommandError = function (output, context) {
2166
2188
  return [4, parseBody(output.body, context)];
2167
2189
  case 1:
2168
2190
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2169
- errorCode = "UnknownError";
2170
2191
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2171
2192
  _b = errorCode;
2172
2193
  switch (_b) {
@@ -2202,10 +2223,12 @@ var deserializeAws_json1_1GenerateMacCommandError = function (output, context) {
2202
2223
  case 15: throw _d.sent();
2203
2224
  case 16:
2204
2225
  parsedBody = parsedOutput.body;
2226
+ $metadata = deserializeMetadata(output);
2227
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2205
2228
  response = new __BaseException({
2206
- name: parsedBody.code || parsedBody.Code || errorCode,
2229
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2207
2230
  $fault: "client",
2208
- $metadata: deserializeMetadata(output),
2231
+ $metadata: $metadata,
2209
2232
  });
2210
2233
  throw __decorateServiceException(response, parsedBody);
2211
2234
  }
@@ -2230,7 +2253,7 @@ export var deserializeAws_json1_1GenerateRandomCommand = function (output, conte
2230
2253
  });
2231
2254
  }); };
2232
2255
  var deserializeAws_json1_1GenerateRandomCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2233
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2256
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2234
2257
  var _c;
2235
2258
  return __generator(this, function (_d) {
2236
2259
  switch (_d.label) {
@@ -2240,7 +2263,6 @@ var deserializeAws_json1_1GenerateRandomCommandError = function (output, context
2240
2263
  return [4, parseBody(output.body, context)];
2241
2264
  case 1:
2242
2265
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2243
- errorCode = "UnknownError";
2244
2266
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2245
2267
  _b = errorCode;
2246
2268
  switch (_b) {
@@ -2264,10 +2286,12 @@ var deserializeAws_json1_1GenerateRandomCommandError = function (output, context
2264
2286
  case 9: throw _d.sent();
2265
2287
  case 10:
2266
2288
  parsedBody = parsedOutput.body;
2289
+ $metadata = deserializeMetadata(output);
2290
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2267
2291
  response = new __BaseException({
2268
- name: parsedBody.code || parsedBody.Code || errorCode,
2292
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2269
2293
  $fault: "client",
2270
- $metadata: deserializeMetadata(output),
2294
+ $metadata: $metadata,
2271
2295
  });
2272
2296
  throw __decorateServiceException(response, parsedBody);
2273
2297
  }
@@ -2292,7 +2316,7 @@ export var deserializeAws_json1_1GetKeyPolicyCommand = function (output, context
2292
2316
  });
2293
2317
  }); };
2294
2318
  var deserializeAws_json1_1GetKeyPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2295
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2319
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2296
2320
  var _c;
2297
2321
  return __generator(this, function (_d) {
2298
2322
  switch (_d.label) {
@@ -2302,7 +2326,6 @@ var deserializeAws_json1_1GetKeyPolicyCommandError = function (output, context)
2302
2326
  return [4, parseBody(output.body, context)];
2303
2327
  case 1:
2304
2328
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2305
- errorCode = "UnknownError";
2306
2329
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2307
2330
  _b = errorCode;
2308
2331
  switch (_b) {
@@ -2330,10 +2353,12 @@ var deserializeAws_json1_1GetKeyPolicyCommandError = function (output, context)
2330
2353
  case 11: throw _d.sent();
2331
2354
  case 12:
2332
2355
  parsedBody = parsedOutput.body;
2356
+ $metadata = deserializeMetadata(output);
2357
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2333
2358
  response = new __BaseException({
2334
- name: parsedBody.code || parsedBody.Code || errorCode,
2359
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2335
2360
  $fault: "client",
2336
- $metadata: deserializeMetadata(output),
2361
+ $metadata: $metadata,
2337
2362
  });
2338
2363
  throw __decorateServiceException(response, parsedBody);
2339
2364
  }
@@ -2358,7 +2383,7 @@ export var deserializeAws_json1_1GetKeyRotationStatusCommand = function (output,
2358
2383
  });
2359
2384
  }); };
2360
2385
  var deserializeAws_json1_1GetKeyRotationStatusCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2361
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2386
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2362
2387
  var _c;
2363
2388
  return __generator(this, function (_d) {
2364
2389
  switch (_d.label) {
@@ -2368,7 +2393,6 @@ var deserializeAws_json1_1GetKeyRotationStatusCommandError = function (output, c
2368
2393
  return [4, parseBody(output.body, context)];
2369
2394
  case 1:
2370
2395
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2371
- errorCode = "UnknownError";
2372
2396
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2373
2397
  _b = errorCode;
2374
2398
  switch (_b) {
@@ -2400,10 +2424,12 @@ var deserializeAws_json1_1GetKeyRotationStatusCommandError = function (output, c
2400
2424
  case 13: throw _d.sent();
2401
2425
  case 14:
2402
2426
  parsedBody = parsedOutput.body;
2427
+ $metadata = deserializeMetadata(output);
2428
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2403
2429
  response = new __BaseException({
2404
- name: parsedBody.code || parsedBody.Code || errorCode,
2430
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2405
2431
  $fault: "client",
2406
- $metadata: deserializeMetadata(output),
2432
+ $metadata: $metadata,
2407
2433
  });
2408
2434
  throw __decorateServiceException(response, parsedBody);
2409
2435
  }
@@ -2428,7 +2454,7 @@ export var deserializeAws_json1_1GetParametersForImportCommand = function (outpu
2428
2454
  });
2429
2455
  }); };
2430
2456
  var deserializeAws_json1_1GetParametersForImportCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2431
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2457
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2432
2458
  var _c;
2433
2459
  return __generator(this, function (_d) {
2434
2460
  switch (_d.label) {
@@ -2438,7 +2464,6 @@ var deserializeAws_json1_1GetParametersForImportCommandError = function (output,
2438
2464
  return [4, parseBody(output.body, context)];
2439
2465
  case 1:
2440
2466
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2441
- errorCode = "UnknownError";
2442
2467
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2443
2468
  _b = errorCode;
2444
2469
  switch (_b) {
@@ -2470,10 +2495,12 @@ var deserializeAws_json1_1GetParametersForImportCommandError = function (output,
2470
2495
  case 13: throw _d.sent();
2471
2496
  case 14:
2472
2497
  parsedBody = parsedOutput.body;
2498
+ $metadata = deserializeMetadata(output);
2499
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2473
2500
  response = new __BaseException({
2474
- name: parsedBody.code || parsedBody.Code || errorCode,
2501
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2475
2502
  $fault: "client",
2476
- $metadata: deserializeMetadata(output),
2503
+ $metadata: $metadata,
2477
2504
  });
2478
2505
  throw __decorateServiceException(response, parsedBody);
2479
2506
  }
@@ -2498,7 +2525,7 @@ export var deserializeAws_json1_1GetPublicKeyCommand = function (output, context
2498
2525
  });
2499
2526
  }); };
2500
2527
  var deserializeAws_json1_1GetPublicKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2501
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2528
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2502
2529
  var _c;
2503
2530
  return __generator(this, function (_d) {
2504
2531
  switch (_d.label) {
@@ -2508,7 +2535,6 @@ var deserializeAws_json1_1GetPublicKeyCommandError = function (output, context)
2508
2535
  return [4, parseBody(output.body, context)];
2509
2536
  case 1:
2510
2537
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2511
- errorCode = "UnknownError";
2512
2538
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2513
2539
  _b = errorCode;
2514
2540
  switch (_b) {
@@ -2556,10 +2582,12 @@ var deserializeAws_json1_1GetPublicKeyCommandError = function (output, context)
2556
2582
  case 21: throw _d.sent();
2557
2583
  case 22:
2558
2584
  parsedBody = parsedOutput.body;
2585
+ $metadata = deserializeMetadata(output);
2586
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2559
2587
  response = new __BaseException({
2560
- name: parsedBody.code || parsedBody.Code || errorCode,
2588
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2561
2589
  $fault: "client",
2562
- $metadata: deserializeMetadata(output),
2590
+ $metadata: $metadata,
2563
2591
  });
2564
2592
  throw __decorateServiceException(response, parsedBody);
2565
2593
  }
@@ -2584,7 +2612,7 @@ export var deserializeAws_json1_1ImportKeyMaterialCommand = function (output, co
2584
2612
  });
2585
2613
  }); };
2586
2614
  var deserializeAws_json1_1ImportKeyMaterialCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2587
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2615
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2588
2616
  var _c;
2589
2617
  return __generator(this, function (_d) {
2590
2618
  switch (_d.label) {
@@ -2594,7 +2622,6 @@ var deserializeAws_json1_1ImportKeyMaterialCommandError = function (output, cont
2594
2622
  return [4, parseBody(output.body, context)];
2595
2623
  case 1:
2596
2624
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2597
- errorCode = "UnknownError";
2598
2625
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2599
2626
  _b = errorCode;
2600
2627
  switch (_b) {
@@ -2642,10 +2669,12 @@ var deserializeAws_json1_1ImportKeyMaterialCommandError = function (output, cont
2642
2669
  case 21: throw _d.sent();
2643
2670
  case 22:
2644
2671
  parsedBody = parsedOutput.body;
2672
+ $metadata = deserializeMetadata(output);
2673
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2645
2674
  response = new __BaseException({
2646
- name: parsedBody.code || parsedBody.Code || errorCode,
2675
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2647
2676
  $fault: "client",
2648
- $metadata: deserializeMetadata(output),
2677
+ $metadata: $metadata,
2649
2678
  });
2650
2679
  throw __decorateServiceException(response, parsedBody);
2651
2680
  }
@@ -2670,7 +2699,7 @@ export var deserializeAws_json1_1ListAliasesCommand = function (output, context)
2670
2699
  });
2671
2700
  }); };
2672
2701
  var deserializeAws_json1_1ListAliasesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2673
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2702
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2674
2703
  var _c;
2675
2704
  return __generator(this, function (_d) {
2676
2705
  switch (_d.label) {
@@ -2680,7 +2709,6 @@ var deserializeAws_json1_1ListAliasesCommandError = function (output, context) {
2680
2709
  return [4, parseBody(output.body, context)];
2681
2710
  case 1:
2682
2711
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2683
- errorCode = "UnknownError";
2684
2712
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2685
2713
  _b = errorCode;
2686
2714
  switch (_b) {
@@ -2708,10 +2736,12 @@ var deserializeAws_json1_1ListAliasesCommandError = function (output, context) {
2708
2736
  case 11: throw _d.sent();
2709
2737
  case 12:
2710
2738
  parsedBody = parsedOutput.body;
2739
+ $metadata = deserializeMetadata(output);
2740
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2711
2741
  response = new __BaseException({
2712
- name: parsedBody.code || parsedBody.Code || errorCode,
2742
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2713
2743
  $fault: "client",
2714
- $metadata: deserializeMetadata(output),
2744
+ $metadata: $metadata,
2715
2745
  });
2716
2746
  throw __decorateServiceException(response, parsedBody);
2717
2747
  }
@@ -2736,7 +2766,7 @@ export var deserializeAws_json1_1ListGrantsCommand = function (output, context)
2736
2766
  });
2737
2767
  }); };
2738
2768
  var deserializeAws_json1_1ListGrantsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2739
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2769
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2740
2770
  var _c;
2741
2771
  return __generator(this, function (_d) {
2742
2772
  switch (_d.label) {
@@ -2746,7 +2776,6 @@ var deserializeAws_json1_1ListGrantsCommandError = function (output, context) {
2746
2776
  return [4, parseBody(output.body, context)];
2747
2777
  case 1:
2748
2778
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2749
- errorCode = "UnknownError";
2750
2779
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2751
2780
  _b = errorCode;
2752
2781
  switch (_b) {
@@ -2782,10 +2811,12 @@ var deserializeAws_json1_1ListGrantsCommandError = function (output, context) {
2782
2811
  case 15: throw _d.sent();
2783
2812
  case 16:
2784
2813
  parsedBody = parsedOutput.body;
2814
+ $metadata = deserializeMetadata(output);
2815
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2785
2816
  response = new __BaseException({
2786
- name: parsedBody.code || parsedBody.Code || errorCode,
2817
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2787
2818
  $fault: "client",
2788
- $metadata: deserializeMetadata(output),
2819
+ $metadata: $metadata,
2789
2820
  });
2790
2821
  throw __decorateServiceException(response, parsedBody);
2791
2822
  }
@@ -2810,7 +2841,7 @@ export var deserializeAws_json1_1ListKeyPoliciesCommand = function (output, cont
2810
2841
  });
2811
2842
  }); };
2812
2843
  var deserializeAws_json1_1ListKeyPoliciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2813
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2844
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2814
2845
  var _c;
2815
2846
  return __generator(this, function (_d) {
2816
2847
  switch (_d.label) {
@@ -2820,7 +2851,6 @@ var deserializeAws_json1_1ListKeyPoliciesCommandError = function (output, contex
2820
2851
  return [4, parseBody(output.body, context)];
2821
2852
  case 1:
2822
2853
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2823
- errorCode = "UnknownError";
2824
2854
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2825
2855
  _b = errorCode;
2826
2856
  switch (_b) {
@@ -2848,10 +2878,12 @@ var deserializeAws_json1_1ListKeyPoliciesCommandError = function (output, contex
2848
2878
  case 11: throw _d.sent();
2849
2879
  case 12:
2850
2880
  parsedBody = parsedOutput.body;
2881
+ $metadata = deserializeMetadata(output);
2882
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2851
2883
  response = new __BaseException({
2852
- name: parsedBody.code || parsedBody.Code || errorCode,
2884
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2853
2885
  $fault: "client",
2854
- $metadata: deserializeMetadata(output),
2886
+ $metadata: $metadata,
2855
2887
  });
2856
2888
  throw __decorateServiceException(response, parsedBody);
2857
2889
  }
@@ -2876,7 +2908,7 @@ export var deserializeAws_json1_1ListKeysCommand = function (output, context) {
2876
2908
  });
2877
2909
  }); };
2878
2910
  var deserializeAws_json1_1ListKeysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2879
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2911
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2880
2912
  var _c;
2881
2913
  return __generator(this, function (_d) {
2882
2914
  switch (_d.label) {
@@ -2886,7 +2918,6 @@ var deserializeAws_json1_1ListKeysCommandError = function (output, context) { re
2886
2918
  return [4, parseBody(output.body, context)];
2887
2919
  case 1:
2888
2920
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2889
- errorCode = "UnknownError";
2890
2921
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2891
2922
  _b = errorCode;
2892
2923
  switch (_b) {
@@ -2906,10 +2937,12 @@ var deserializeAws_json1_1ListKeysCommandError = function (output, context) { re
2906
2937
  case 7: throw _d.sent();
2907
2938
  case 8:
2908
2939
  parsedBody = parsedOutput.body;
2940
+ $metadata = deserializeMetadata(output);
2941
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2909
2942
  response = new __BaseException({
2910
- name: parsedBody.code || parsedBody.Code || errorCode,
2943
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2911
2944
  $fault: "client",
2912
- $metadata: deserializeMetadata(output),
2945
+ $metadata: $metadata,
2913
2946
  });
2914
2947
  throw __decorateServiceException(response, parsedBody);
2915
2948
  }
@@ -2934,7 +2967,7 @@ export var deserializeAws_json1_1ListResourceTagsCommand = function (output, con
2934
2967
  });
2935
2968
  }); };
2936
2969
  var deserializeAws_json1_1ListResourceTagsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2937
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
2970
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2938
2971
  var _c;
2939
2972
  return __generator(this, function (_d) {
2940
2973
  switch (_d.label) {
@@ -2944,7 +2977,6 @@ var deserializeAws_json1_1ListResourceTagsCommandError = function (output, conte
2944
2977
  return [4, parseBody(output.body, context)];
2945
2978
  case 1:
2946
2979
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2947
- errorCode = "UnknownError";
2948
2980
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2949
2981
  _b = errorCode;
2950
2982
  switch (_b) {
@@ -2968,10 +3000,12 @@ var deserializeAws_json1_1ListResourceTagsCommandError = function (output, conte
2968
3000
  case 9: throw _d.sent();
2969
3001
  case 10:
2970
3002
  parsedBody = parsedOutput.body;
3003
+ $metadata = deserializeMetadata(output);
3004
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2971
3005
  response = new __BaseException({
2972
- name: parsedBody.code || parsedBody.Code || errorCode,
3006
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2973
3007
  $fault: "client",
2974
- $metadata: deserializeMetadata(output),
3008
+ $metadata: $metadata,
2975
3009
  });
2976
3010
  throw __decorateServiceException(response, parsedBody);
2977
3011
  }
@@ -2996,7 +3030,7 @@ export var deserializeAws_json1_1ListRetirableGrantsCommand = function (output,
2996
3030
  });
2997
3031
  }); };
2998
3032
  var deserializeAws_json1_1ListRetirableGrantsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2999
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3033
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3000
3034
  var _c;
3001
3035
  return __generator(this, function (_d) {
3002
3036
  switch (_d.label) {
@@ -3006,7 +3040,6 @@ var deserializeAws_json1_1ListRetirableGrantsCommandError = function (output, co
3006
3040
  return [4, parseBody(output.body, context)];
3007
3041
  case 1:
3008
3042
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3009
- errorCode = "UnknownError";
3010
3043
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3011
3044
  _b = errorCode;
3012
3045
  switch (_b) {
@@ -3034,10 +3067,12 @@ var deserializeAws_json1_1ListRetirableGrantsCommandError = function (output, co
3034
3067
  case 11: throw _d.sent();
3035
3068
  case 12:
3036
3069
  parsedBody = parsedOutput.body;
3070
+ $metadata = deserializeMetadata(output);
3071
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3037
3072
  response = new __BaseException({
3038
- name: parsedBody.code || parsedBody.Code || errorCode,
3073
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3039
3074
  $fault: "client",
3040
- $metadata: deserializeMetadata(output),
3075
+ $metadata: $metadata,
3041
3076
  });
3042
3077
  throw __decorateServiceException(response, parsedBody);
3043
3078
  }
@@ -3062,7 +3097,7 @@ export var deserializeAws_json1_1PutKeyPolicyCommand = function (output, context
3062
3097
  });
3063
3098
  }); };
3064
3099
  var deserializeAws_json1_1PutKeyPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3065
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3100
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3066
3101
  var _c;
3067
3102
  return __generator(this, function (_d) {
3068
3103
  switch (_d.label) {
@@ -3072,7 +3107,6 @@ var deserializeAws_json1_1PutKeyPolicyCommandError = function (output, context)
3072
3107
  return [4, parseBody(output.body, context)];
3073
3108
  case 1:
3074
3109
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3075
- errorCode = "UnknownError";
3076
3110
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3077
3111
  _b = errorCode;
3078
3112
  switch (_b) {
@@ -3112,10 +3146,12 @@ var deserializeAws_json1_1PutKeyPolicyCommandError = function (output, context)
3112
3146
  case 17: throw _d.sent();
3113
3147
  case 18:
3114
3148
  parsedBody = parsedOutput.body;
3149
+ $metadata = deserializeMetadata(output);
3150
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3115
3151
  response = new __BaseException({
3116
- name: parsedBody.code || parsedBody.Code || errorCode,
3152
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3117
3153
  $fault: "client",
3118
- $metadata: deserializeMetadata(output),
3154
+ $metadata: $metadata,
3119
3155
  });
3120
3156
  throw __decorateServiceException(response, parsedBody);
3121
3157
  }
@@ -3140,7 +3176,7 @@ export var deserializeAws_json1_1ReEncryptCommand = function (output, context) {
3140
3176
  });
3141
3177
  }); };
3142
3178
  var deserializeAws_json1_1ReEncryptCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3143
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3179
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3144
3180
  var _c;
3145
3181
  return __generator(this, function (_d) {
3146
3182
  switch (_d.label) {
@@ -3150,7 +3186,6 @@ var deserializeAws_json1_1ReEncryptCommandError = function (output, context) { r
3150
3186
  return [4, parseBody(output.body, context)];
3151
3187
  case 1:
3152
3188
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3153
- errorCode = "UnknownError";
3154
3189
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3155
3190
  _b = errorCode;
3156
3191
  switch (_b) {
@@ -3198,10 +3233,12 @@ var deserializeAws_json1_1ReEncryptCommandError = function (output, context) { r
3198
3233
  case 21: throw _d.sent();
3199
3234
  case 22:
3200
3235
  parsedBody = parsedOutput.body;
3236
+ $metadata = deserializeMetadata(output);
3237
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3201
3238
  response = new __BaseException({
3202
- name: parsedBody.code || parsedBody.Code || errorCode,
3239
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3203
3240
  $fault: "client",
3204
- $metadata: deserializeMetadata(output),
3241
+ $metadata: $metadata,
3205
3242
  });
3206
3243
  throw __decorateServiceException(response, parsedBody);
3207
3244
  }
@@ -3226,7 +3263,7 @@ export var deserializeAws_json1_1ReplicateKeyCommand = function (output, context
3226
3263
  });
3227
3264
  }); };
3228
3265
  var deserializeAws_json1_1ReplicateKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3229
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3266
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3230
3267
  var _c;
3231
3268
  return __generator(this, function (_d) {
3232
3269
  switch (_d.label) {
@@ -3236,7 +3273,6 @@ var deserializeAws_json1_1ReplicateKeyCommandError = function (output, context)
3236
3273
  return [4, parseBody(output.body, context)];
3237
3274
  case 1:
3238
3275
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3239
- errorCode = "UnknownError";
3240
3276
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3241
3277
  _b = errorCode;
3242
3278
  switch (_b) {
@@ -3284,10 +3320,12 @@ var deserializeAws_json1_1ReplicateKeyCommandError = function (output, context)
3284
3320
  case 21: throw _d.sent();
3285
3321
  case 22:
3286
3322
  parsedBody = parsedOutput.body;
3323
+ $metadata = deserializeMetadata(output);
3324
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3287
3325
  response = new __BaseException({
3288
- name: parsedBody.code || parsedBody.Code || errorCode,
3326
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3289
3327
  $fault: "client",
3290
- $metadata: deserializeMetadata(output),
3328
+ $metadata: $metadata,
3291
3329
  });
3292
3330
  throw __decorateServiceException(response, parsedBody);
3293
3331
  }
@@ -3312,7 +3350,7 @@ export var deserializeAws_json1_1RetireGrantCommand = function (output, context)
3312
3350
  });
3313
3351
  }); };
3314
3352
  var deserializeAws_json1_1RetireGrantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3315
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3353
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3316
3354
  var _c;
3317
3355
  return __generator(this, function (_d) {
3318
3356
  switch (_d.label) {
@@ -3322,7 +3360,6 @@ var deserializeAws_json1_1RetireGrantCommandError = function (output, context) {
3322
3360
  return [4, parseBody(output.body, context)];
3323
3361
  case 1:
3324
3362
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3325
- errorCode = "UnknownError";
3326
3363
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3327
3364
  _b = errorCode;
3328
3365
  switch (_b) {
@@ -3358,10 +3395,12 @@ var deserializeAws_json1_1RetireGrantCommandError = function (output, context) {
3358
3395
  case 15: throw _d.sent();
3359
3396
  case 16:
3360
3397
  parsedBody = parsedOutput.body;
3398
+ $metadata = deserializeMetadata(output);
3399
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3361
3400
  response = new __BaseException({
3362
- name: parsedBody.code || parsedBody.Code || errorCode,
3401
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3363
3402
  $fault: "client",
3364
- $metadata: deserializeMetadata(output),
3403
+ $metadata: $metadata,
3365
3404
  });
3366
3405
  throw __decorateServiceException(response, parsedBody);
3367
3406
  }
@@ -3386,7 +3425,7 @@ export var deserializeAws_json1_1RevokeGrantCommand = function (output, context)
3386
3425
  });
3387
3426
  }); };
3388
3427
  var deserializeAws_json1_1RevokeGrantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3389
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3428
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3390
3429
  var _c;
3391
3430
  return __generator(this, function (_d) {
3392
3431
  switch (_d.label) {
@@ -3396,7 +3435,6 @@ var deserializeAws_json1_1RevokeGrantCommandError = function (output, context) {
3396
3435
  return [4, parseBody(output.body, context)];
3397
3436
  case 1:
3398
3437
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3399
- errorCode = "UnknownError";
3400
3438
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3401
3439
  _b = errorCode;
3402
3440
  switch (_b) {
@@ -3428,10 +3466,12 @@ var deserializeAws_json1_1RevokeGrantCommandError = function (output, context) {
3428
3466
  case 13: throw _d.sent();
3429
3467
  case 14:
3430
3468
  parsedBody = parsedOutput.body;
3469
+ $metadata = deserializeMetadata(output);
3470
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3431
3471
  response = new __BaseException({
3432
- name: parsedBody.code || parsedBody.Code || errorCode,
3472
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3433
3473
  $fault: "client",
3434
- $metadata: deserializeMetadata(output),
3474
+ $metadata: $metadata,
3435
3475
  });
3436
3476
  throw __decorateServiceException(response, parsedBody);
3437
3477
  }
@@ -3456,7 +3496,7 @@ export var deserializeAws_json1_1ScheduleKeyDeletionCommand = function (output,
3456
3496
  });
3457
3497
  }); };
3458
3498
  var deserializeAws_json1_1ScheduleKeyDeletionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3459
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3499
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3460
3500
  var _c;
3461
3501
  return __generator(this, function (_d) {
3462
3502
  switch (_d.label) {
@@ -3466,7 +3506,6 @@ var deserializeAws_json1_1ScheduleKeyDeletionCommandError = function (output, co
3466
3506
  return [4, parseBody(output.body, context)];
3467
3507
  case 1:
3468
3508
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3469
- errorCode = "UnknownError";
3470
3509
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3471
3510
  _b = errorCode;
3472
3511
  switch (_b) {
@@ -3494,10 +3533,12 @@ var deserializeAws_json1_1ScheduleKeyDeletionCommandError = function (output, co
3494
3533
  case 11: throw _d.sent();
3495
3534
  case 12:
3496
3535
  parsedBody = parsedOutput.body;
3536
+ $metadata = deserializeMetadata(output);
3537
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3497
3538
  response = new __BaseException({
3498
- name: parsedBody.code || parsedBody.Code || errorCode,
3539
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3499
3540
  $fault: "client",
3500
- $metadata: deserializeMetadata(output),
3541
+ $metadata: $metadata,
3501
3542
  });
3502
3543
  throw __decorateServiceException(response, parsedBody);
3503
3544
  }
@@ -3522,7 +3563,7 @@ export var deserializeAws_json1_1SignCommand = function (output, context) { retu
3522
3563
  });
3523
3564
  }); };
3524
3565
  var deserializeAws_json1_1SignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3525
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3566
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3526
3567
  var _c;
3527
3568
  return __generator(this, function (_d) {
3528
3569
  switch (_d.label) {
@@ -3532,7 +3573,6 @@ var deserializeAws_json1_1SignCommandError = function (output, context) { return
3532
3573
  return [4, parseBody(output.body, context)];
3533
3574
  case 1:
3534
3575
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3535
- errorCode = "UnknownError";
3536
3576
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3537
3577
  _b = errorCode;
3538
3578
  switch (_b) {
@@ -3572,10 +3612,12 @@ var deserializeAws_json1_1SignCommandError = function (output, context) { return
3572
3612
  case 17: throw _d.sent();
3573
3613
  case 18:
3574
3614
  parsedBody = parsedOutput.body;
3615
+ $metadata = deserializeMetadata(output);
3616
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3575
3617
  response = new __BaseException({
3576
- name: parsedBody.code || parsedBody.Code || errorCode,
3618
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3577
3619
  $fault: "client",
3578
- $metadata: deserializeMetadata(output),
3620
+ $metadata: $metadata,
3579
3621
  });
3580
3622
  throw __decorateServiceException(response, parsedBody);
3581
3623
  }
@@ -3600,7 +3642,7 @@ export var deserializeAws_json1_1TagResourceCommand = function (output, context)
3600
3642
  });
3601
3643
  }); };
3602
3644
  var deserializeAws_json1_1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3603
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3645
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3604
3646
  var _c;
3605
3647
  return __generator(this, function (_d) {
3606
3648
  switch (_d.label) {
@@ -3610,7 +3652,6 @@ var deserializeAws_json1_1TagResourceCommandError = function (output, context) {
3610
3652
  return [4, parseBody(output.body, context)];
3611
3653
  case 1:
3612
3654
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3613
- errorCode = "UnknownError";
3614
3655
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3615
3656
  _b = errorCode;
3616
3657
  switch (_b) {
@@ -3642,10 +3683,12 @@ var deserializeAws_json1_1TagResourceCommandError = function (output, context) {
3642
3683
  case 13: throw _d.sent();
3643
3684
  case 14:
3644
3685
  parsedBody = parsedOutput.body;
3686
+ $metadata = deserializeMetadata(output);
3687
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3645
3688
  response = new __BaseException({
3646
- name: parsedBody.code || parsedBody.Code || errorCode,
3689
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3647
3690
  $fault: "client",
3648
- $metadata: deserializeMetadata(output),
3691
+ $metadata: $metadata,
3649
3692
  });
3650
3693
  throw __decorateServiceException(response, parsedBody);
3651
3694
  }
@@ -3670,7 +3713,7 @@ export var deserializeAws_json1_1UntagResourceCommand = function (output, contex
3670
3713
  });
3671
3714
  }); };
3672
3715
  var deserializeAws_json1_1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3673
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3716
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3674
3717
  var _c;
3675
3718
  return __generator(this, function (_d) {
3676
3719
  switch (_d.label) {
@@ -3680,7 +3723,6 @@ var deserializeAws_json1_1UntagResourceCommandError = function (output, context)
3680
3723
  return [4, parseBody(output.body, context)];
3681
3724
  case 1:
3682
3725
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3683
- errorCode = "UnknownError";
3684
3726
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3685
3727
  _b = errorCode;
3686
3728
  switch (_b) {
@@ -3708,10 +3750,12 @@ var deserializeAws_json1_1UntagResourceCommandError = function (output, context)
3708
3750
  case 11: throw _d.sent();
3709
3751
  case 12:
3710
3752
  parsedBody = parsedOutput.body;
3753
+ $metadata = deserializeMetadata(output);
3754
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3711
3755
  response = new __BaseException({
3712
- name: parsedBody.code || parsedBody.Code || errorCode,
3756
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3713
3757
  $fault: "client",
3714
- $metadata: deserializeMetadata(output),
3758
+ $metadata: $metadata,
3715
3759
  });
3716
3760
  throw __decorateServiceException(response, parsedBody);
3717
3761
  }
@@ -3736,7 +3780,7 @@ export var deserializeAws_json1_1UpdateAliasCommand = function (output, context)
3736
3780
  });
3737
3781
  }); };
3738
3782
  var deserializeAws_json1_1UpdateAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3739
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3783
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3740
3784
  var _c;
3741
3785
  return __generator(this, function (_d) {
3742
3786
  switch (_d.label) {
@@ -3746,7 +3790,6 @@ var deserializeAws_json1_1UpdateAliasCommandError = function (output, context) {
3746
3790
  return [4, parseBody(output.body, context)];
3747
3791
  case 1:
3748
3792
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3749
- errorCode = "UnknownError";
3750
3793
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3751
3794
  _b = errorCode;
3752
3795
  switch (_b) {
@@ -3774,10 +3817,12 @@ var deserializeAws_json1_1UpdateAliasCommandError = function (output, context) {
3774
3817
  case 11: throw _d.sent();
3775
3818
  case 12:
3776
3819
  parsedBody = parsedOutput.body;
3820
+ $metadata = deserializeMetadata(output);
3821
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3777
3822
  response = new __BaseException({
3778
- name: parsedBody.code || parsedBody.Code || errorCode,
3823
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3779
3824
  $fault: "client",
3780
- $metadata: deserializeMetadata(output),
3825
+ $metadata: $metadata,
3781
3826
  });
3782
3827
  throw __decorateServiceException(response, parsedBody);
3783
3828
  }
@@ -3802,7 +3847,7 @@ export var deserializeAws_json1_1UpdateCustomKeyStoreCommand = function (output,
3802
3847
  });
3803
3848
  }); };
3804
3849
  var deserializeAws_json1_1UpdateCustomKeyStoreCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3805
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3850
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3806
3851
  var _c;
3807
3852
  return __generator(this, function (_d) {
3808
3853
  switch (_d.label) {
@@ -3812,7 +3857,6 @@ var deserializeAws_json1_1UpdateCustomKeyStoreCommandError = function (output, c
3812
3857
  return [4, parseBody(output.body, context)];
3813
3858
  case 1:
3814
3859
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3815
- errorCode = "UnknownError";
3816
3860
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3817
3861
  _b = errorCode;
3818
3862
  switch (_b) {
@@ -3852,10 +3896,12 @@ var deserializeAws_json1_1UpdateCustomKeyStoreCommandError = function (output, c
3852
3896
  case 17: throw _d.sent();
3853
3897
  case 18:
3854
3898
  parsedBody = parsedOutput.body;
3899
+ $metadata = deserializeMetadata(output);
3900
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3855
3901
  response = new __BaseException({
3856
- name: parsedBody.code || parsedBody.Code || errorCode,
3902
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3857
3903
  $fault: "client",
3858
- $metadata: deserializeMetadata(output),
3904
+ $metadata: $metadata,
3859
3905
  });
3860
3906
  throw __decorateServiceException(response, parsedBody);
3861
3907
  }
@@ -3880,7 +3926,7 @@ export var deserializeAws_json1_1UpdateKeyDescriptionCommand = function (output,
3880
3926
  });
3881
3927
  }); };
3882
3928
  var deserializeAws_json1_1UpdateKeyDescriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3883
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3929
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3884
3930
  var _c;
3885
3931
  return __generator(this, function (_d) {
3886
3932
  switch (_d.label) {
@@ -3890,7 +3936,6 @@ var deserializeAws_json1_1UpdateKeyDescriptionCommandError = function (output, c
3890
3936
  return [4, parseBody(output.body, context)];
3891
3937
  case 1:
3892
3938
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3893
- errorCode = "UnknownError";
3894
3939
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3895
3940
  _b = errorCode;
3896
3941
  switch (_b) {
@@ -3918,10 +3963,12 @@ var deserializeAws_json1_1UpdateKeyDescriptionCommandError = function (output, c
3918
3963
  case 11: throw _d.sent();
3919
3964
  case 12:
3920
3965
  parsedBody = parsedOutput.body;
3966
+ $metadata = deserializeMetadata(output);
3967
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3921
3968
  response = new __BaseException({
3922
- name: parsedBody.code || parsedBody.Code || errorCode,
3969
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3923
3970
  $fault: "client",
3924
- $metadata: deserializeMetadata(output),
3971
+ $metadata: $metadata,
3925
3972
  });
3926
3973
  throw __decorateServiceException(response, parsedBody);
3927
3974
  }
@@ -3946,7 +3993,7 @@ export var deserializeAws_json1_1UpdatePrimaryRegionCommand = function (output,
3946
3993
  });
3947
3994
  }); };
3948
3995
  var deserializeAws_json1_1UpdatePrimaryRegionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3949
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
3996
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3950
3997
  var _c;
3951
3998
  return __generator(this, function (_d) {
3952
3999
  switch (_d.label) {
@@ -3956,7 +4003,6 @@ var deserializeAws_json1_1UpdatePrimaryRegionCommandError = function (output, co
3956
4003
  return [4, parseBody(output.body, context)];
3957
4004
  case 1:
3958
4005
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3959
- errorCode = "UnknownError";
3960
4006
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3961
4007
  _b = errorCode;
3962
4008
  switch (_b) {
@@ -3988,10 +4034,12 @@ var deserializeAws_json1_1UpdatePrimaryRegionCommandError = function (output, co
3988
4034
  case 13: throw _d.sent();
3989
4035
  case 14:
3990
4036
  parsedBody = parsedOutput.body;
4037
+ $metadata = deserializeMetadata(output);
4038
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3991
4039
  response = new __BaseException({
3992
- name: parsedBody.code || parsedBody.Code || errorCode,
4040
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3993
4041
  $fault: "client",
3994
- $metadata: deserializeMetadata(output),
4042
+ $metadata: $metadata,
3995
4043
  });
3996
4044
  throw __decorateServiceException(response, parsedBody);
3997
4045
  }
@@ -4016,7 +4064,7 @@ export var deserializeAws_json1_1VerifyCommand = function (output, context) { re
4016
4064
  });
4017
4065
  }); };
4018
4066
  var deserializeAws_json1_1VerifyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4019
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
4067
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4020
4068
  var _c;
4021
4069
  return __generator(this, function (_d) {
4022
4070
  switch (_d.label) {
@@ -4026,7 +4074,6 @@ var deserializeAws_json1_1VerifyCommandError = function (output, context) { retu
4026
4074
  return [4, parseBody(output.body, context)];
4027
4075
  case 1:
4028
4076
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
4029
- errorCode = "UnknownError";
4030
4077
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4031
4078
  _b = errorCode;
4032
4079
  switch (_b) {
@@ -4070,10 +4117,12 @@ var deserializeAws_json1_1VerifyCommandError = function (output, context) { retu
4070
4117
  case 19: throw _d.sent();
4071
4118
  case 20:
4072
4119
  parsedBody = parsedOutput.body;
4120
+ $metadata = deserializeMetadata(output);
4121
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4073
4122
  response = new __BaseException({
4074
- name: parsedBody.code || parsedBody.Code || errorCode,
4123
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4075
4124
  $fault: "client",
4076
- $metadata: deserializeMetadata(output),
4125
+ $metadata: $metadata,
4077
4126
  });
4078
4127
  throw __decorateServiceException(response, parsedBody);
4079
4128
  }
@@ -4098,7 +4147,7 @@ export var deserializeAws_json1_1VerifyMacCommand = function (output, context) {
4098
4147
  });
4099
4148
  }); };
4100
4149
  var deserializeAws_json1_1VerifyMacCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4101
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
4150
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4102
4151
  var _c;
4103
4152
  return __generator(this, function (_d) {
4104
4153
  switch (_d.label) {
@@ -4108,7 +4157,6 @@ var deserializeAws_json1_1VerifyMacCommandError = function (output, context) { r
4108
4157
  return [4, parseBody(output.body, context)];
4109
4158
  case 1:
4110
4159
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
4111
- errorCode = "UnknownError";
4112
4160
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4113
4161
  _b = errorCode;
4114
4162
  switch (_b) {
@@ -4148,10 +4196,12 @@ var deserializeAws_json1_1VerifyMacCommandError = function (output, context) { r
4148
4196
  case 17: throw _d.sent();
4149
4197
  case 18:
4150
4198
  parsedBody = parsedOutput.body;
4199
+ $metadata = deserializeMetadata(output);
4200
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4151
4201
  response = new __BaseException({
4152
- name: parsedBody.code || parsedBody.Code || errorCode,
4202
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4153
4203
  $fault: "client",
4154
- $metadata: deserializeMetadata(output),
4204
+ $metadata: $metadata,
4155
4205
  });
4156
4206
  throw __decorateServiceException(response, parsedBody);
4157
4207
  }
@@ -4464,81 +4514,59 @@ var deserializeAws_json1_1UnsupportedOperationExceptionResponse = function (pars
4464
4514
  });
4465
4515
  }); };
4466
4516
  var serializeAws_json1_1CancelKeyDeletionRequest = function (input, context) {
4467
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4517
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4468
4518
  };
4469
4519
  var serializeAws_json1_1ConnectCustomKeyStoreRequest = function (input, context) {
4470
- return __assign({}, (input.CustomKeyStoreId !== undefined &&
4471
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4520
+ return __assign({}, (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4472
4521
  };
4473
4522
  var serializeAws_json1_1CreateAliasRequest = function (input, context) {
4474
- return __assign(__assign({}, (input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName })), (input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }));
4523
+ return __assign(__assign({}, (input.AliasName != null && { AliasName: input.AliasName })), (input.TargetKeyId != null && { TargetKeyId: input.TargetKeyId }));
4475
4524
  };
4476
4525
  var serializeAws_json1_1CreateCustomKeyStoreRequest = function (input, context) {
4477
- return __assign(__assign(__assign(__assign({}, (input.CloudHsmClusterId !== undefined &&
4478
- input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId })), (input.CustomKeyStoreName !== undefined &&
4479
- input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName })), (input.KeyStorePassword !== undefined &&
4480
- input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword })), (input.TrustAnchorCertificate !== undefined &&
4481
- input.TrustAnchorCertificate !== null && { TrustAnchorCertificate: input.TrustAnchorCertificate }));
4526
+ return __assign(__assign(__assign(__assign({}, (input.CloudHsmClusterId != null && { CloudHsmClusterId: input.CloudHsmClusterId })), (input.CustomKeyStoreName != null && { CustomKeyStoreName: input.CustomKeyStoreName })), (input.KeyStorePassword != null && { KeyStorePassword: input.KeyStorePassword })), (input.TrustAnchorCertificate != null && { TrustAnchorCertificate: input.TrustAnchorCertificate }));
4482
4527
  };
4483
4528
  var serializeAws_json1_1CreateGrantRequest = function (input, context) {
4484
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Constraints !== undefined &&
4485
- input.Constraints !== null && { Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context) })), (input.GrantTokens !== undefined &&
4486
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.GranteePrincipal !== undefined &&
4487
- input.GranteePrincipal !== null && { GranteePrincipal: input.GranteePrincipal })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Operations !== undefined &&
4488
- input.Operations !== null && { Operations: serializeAws_json1_1GrantOperationList(input.Operations, context) })), (input.RetiringPrincipal !== undefined &&
4489
- input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }));
4529
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Constraints != null && { Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context) })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.GranteePrincipal != null && { GranteePrincipal: input.GranteePrincipal })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Name != null && { Name: input.Name })), (input.Operations != null && { Operations: serializeAws_json1_1GrantOperationList(input.Operations, context) })), (input.RetiringPrincipal != null && { RetiringPrincipal: input.RetiringPrincipal }));
4490
4530
  };
4491
4531
  var serializeAws_json1_1CreateKeyRequest = function (input, context) {
4492
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck !== undefined &&
4493
- input.BypassPolicyLockoutSafetyCheck !== null && {
4532
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck != null && {
4494
4533
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
4495
- })), (input.CustomKeyStoreId !== undefined &&
4496
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.CustomerMasterKeySpec !== undefined &&
4497
- input.CustomerMasterKeySpec !== null && { CustomerMasterKeySpec: input.CustomerMasterKeySpec })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec })), (input.KeyUsage !== undefined && input.KeyUsage !== null && { KeyUsage: input.KeyUsage })), (input.MultiRegion !== undefined && input.MultiRegion !== null && { MultiRegion: input.MultiRegion })), (input.Origin !== undefined && input.Origin !== null && { Origin: input.Origin })), (input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4534
+ })), (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.CustomerMasterKeySpec != null && { CustomerMasterKeySpec: input.CustomerMasterKeySpec })), (input.Description != null && { Description: input.Description })), (input.KeySpec != null && { KeySpec: input.KeySpec })), (input.KeyUsage != null && { KeyUsage: input.KeyUsage })), (input.MultiRegion != null && { MultiRegion: input.MultiRegion })), (input.Origin != null && { Origin: input.Origin })), (input.Policy != null && { Policy: input.Policy })), (input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4498
4535
  };
4499
4536
  var serializeAws_json1_1DecryptRequest = function (input, context) {
4500
- return __assign(__assign(__assign(__assign(__assign({}, (input.CiphertextBlob !== undefined &&
4501
- input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) })), (input.EncryptionAlgorithm !== undefined &&
4502
- input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm })), (input.EncryptionContext !== undefined &&
4503
- input.EncryptionContext !== null && {
4537
+ return __assign(__assign(__assign(__assign(__assign({}, (input.CiphertextBlob != null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) })), (input.EncryptionAlgorithm != null && { EncryptionAlgorithm: input.EncryptionAlgorithm })), (input.EncryptionContext != null && {
4504
4538
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4505
- })), (input.GrantTokens !== undefined &&
4506
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4539
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId }));
4507
4540
  };
4508
4541
  var serializeAws_json1_1DeleteAliasRequest = function (input, context) {
4509
- return __assign({}, (input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }));
4542
+ return __assign({}, (input.AliasName != null && { AliasName: input.AliasName }));
4510
4543
  };
4511
4544
  var serializeAws_json1_1DeleteCustomKeyStoreRequest = function (input, context) {
4512
- return __assign({}, (input.CustomKeyStoreId !== undefined &&
4513
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4545
+ return __assign({}, (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4514
4546
  };
4515
4547
  var serializeAws_json1_1DeleteImportedKeyMaterialRequest = function (input, context) {
4516
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4548
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4517
4549
  };
4518
4550
  var serializeAws_json1_1DescribeCustomKeyStoresRequest = function (input, context) {
4519
- return __assign(__assign(__assign(__assign({}, (input.CustomKeyStoreId !== undefined &&
4520
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.CustomKeyStoreName !== undefined &&
4521
- input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName })), (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4551
+ return __assign(__assign(__assign(__assign({}, (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.CustomKeyStoreName != null && { CustomKeyStoreName: input.CustomKeyStoreName })), (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4522
4552
  };
4523
4553
  var serializeAws_json1_1DescribeKeyRequest = function (input, context) {
4524
- return __assign(__assign({}, (input.GrantTokens !== undefined &&
4525
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4554
+ return __assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId }));
4526
4555
  };
4527
4556
  var serializeAws_json1_1DisableKeyRequest = function (input, context) {
4528
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4557
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4529
4558
  };
4530
4559
  var serializeAws_json1_1DisableKeyRotationRequest = function (input, context) {
4531
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4560
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4532
4561
  };
4533
4562
  var serializeAws_json1_1DisconnectCustomKeyStoreRequest = function (input, context) {
4534
- return __assign({}, (input.CustomKeyStoreId !== undefined &&
4535
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4563
+ return __assign({}, (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId }));
4536
4564
  };
4537
4565
  var serializeAws_json1_1EnableKeyRequest = function (input, context) {
4538
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4566
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4539
4567
  };
4540
4568
  var serializeAws_json1_1EnableKeyRotationRequest = function (input, context) {
4541
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4569
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4542
4570
  };
4543
4571
  var serializeAws_json1_1EncryptionContextType = function (input, context) {
4544
4572
  return Object.entries(input).reduce(function (acc, _a) {
@@ -4551,71 +4579,52 @@ var serializeAws_json1_1EncryptionContextType = function (input, context) {
4551
4579
  }, {});
4552
4580
  };
4553
4581
  var serializeAws_json1_1EncryptRequest = function (input, context) {
4554
- return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionAlgorithm !== undefined &&
4555
- input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm })), (input.EncryptionContext !== undefined &&
4556
- input.EncryptionContext !== null && {
4582
+ return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionAlgorithm != null && { EncryptionAlgorithm: input.EncryptionAlgorithm })), (input.EncryptionContext != null && {
4557
4583
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4558
- })), (input.GrantTokens !== undefined &&
4559
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Plaintext !== undefined &&
4560
- input.Plaintext !== null && { Plaintext: context.base64Encoder(input.Plaintext) }));
4584
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Plaintext != null && { Plaintext: context.base64Encoder(input.Plaintext) }));
4561
4585
  };
4562
4586
  var serializeAws_json1_1GenerateDataKeyPairRequest = function (input, context) {
4563
- return __assign(__assign(__assign(__assign({}, (input.EncryptionContext !== undefined &&
4564
- input.EncryptionContext !== null && {
4587
+ return __assign(__assign(__assign(__assign({}, (input.EncryptionContext != null && {
4565
4588
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4566
- })), (input.GrantTokens !== undefined &&
4567
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }));
4589
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.KeyPairSpec != null && { KeyPairSpec: input.KeyPairSpec }));
4568
4590
  };
4569
4591
  var serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextRequest = function (input, context) {
4570
- return __assign(__assign(__assign(__assign({}, (input.EncryptionContext !== undefined &&
4571
- input.EncryptionContext !== null && {
4592
+ return __assign(__assign(__assign(__assign({}, (input.EncryptionContext != null && {
4572
4593
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4573
- })), (input.GrantTokens !== undefined &&
4574
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }));
4594
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.KeyPairSpec != null && { KeyPairSpec: input.KeyPairSpec }));
4575
4595
  };
4576
4596
  var serializeAws_json1_1GenerateDataKeyRequest = function (input, context) {
4577
- return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionContext !== undefined &&
4578
- input.EncryptionContext !== null && {
4597
+ return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionContext != null && {
4579
4598
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4580
- })), (input.GrantTokens !== undefined &&
4581
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec })), (input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }));
4599
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.KeySpec != null && { KeySpec: input.KeySpec })), (input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }));
4582
4600
  };
4583
4601
  var serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest = function (input, context) {
4584
- return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionContext !== undefined &&
4585
- input.EncryptionContext !== null && {
4602
+ return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptionContext != null && {
4586
4603
  EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context),
4587
- })), (input.GrantTokens !== undefined &&
4588
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec })), (input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }));
4604
+ })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.KeySpec != null && { KeySpec: input.KeySpec })), (input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }));
4589
4605
  };
4590
4606
  var serializeAws_json1_1GenerateMacRequest = function (input, context) {
4591
- return __assign(__assign(__assign(__assign({}, (input.GrantTokens !== undefined &&
4592
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm })), (input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }));
4607
+ return __assign(__assign(__assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.MacAlgorithm != null && { MacAlgorithm: input.MacAlgorithm })), (input.Message != null && { Message: context.base64Encoder(input.Message) }));
4593
4608
  };
4594
4609
  var serializeAws_json1_1GenerateRandomRequest = function (input, context) {
4595
- return __assign(__assign({}, (input.CustomKeyStoreId !== undefined &&
4596
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }));
4610
+ return __assign(__assign({}, (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.NumberOfBytes != null && { NumberOfBytes: input.NumberOfBytes }));
4597
4611
  };
4598
4612
  var serializeAws_json1_1GetKeyPolicyRequest = function (input, context) {
4599
- return __assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }));
4613
+ return __assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.PolicyName != null && { PolicyName: input.PolicyName }));
4600
4614
  };
4601
4615
  var serializeAws_json1_1GetKeyRotationStatusRequest = function (input, context) {
4602
- return __assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4616
+ return __assign({}, (input.KeyId != null && { KeyId: input.KeyId }));
4603
4617
  };
4604
4618
  var serializeAws_json1_1GetParametersForImportRequest = function (input, context) {
4605
- return __assign(__assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.WrappingAlgorithm !== undefined &&
4606
- input.WrappingAlgorithm !== null && { WrappingAlgorithm: input.WrappingAlgorithm })), (input.WrappingKeySpec !== undefined &&
4607
- input.WrappingKeySpec !== null && { WrappingKeySpec: input.WrappingKeySpec }));
4619
+ return __assign(__assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.WrappingAlgorithm != null && { WrappingAlgorithm: input.WrappingAlgorithm })), (input.WrappingKeySpec != null && { WrappingKeySpec: input.WrappingKeySpec }));
4608
4620
  };
4609
4621
  var serializeAws_json1_1GetPublicKeyRequest = function (input, context) {
4610
- return __assign(__assign({}, (input.GrantTokens !== undefined &&
4611
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4622
+ return __assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId }));
4612
4623
  };
4613
4624
  var serializeAws_json1_1GrantConstraints = function (input, context) {
4614
- return __assign(__assign({}, (input.EncryptionContextEquals !== undefined &&
4615
- input.EncryptionContextEquals !== null && {
4625
+ return __assign(__assign({}, (input.EncryptionContextEquals != null && {
4616
4626
  EncryptionContextEquals: serializeAws_json1_1EncryptionContextType(input.EncryptionContextEquals, context),
4617
- })), (input.EncryptionContextSubset !== undefined &&
4618
- input.EncryptionContextSubset !== null && {
4627
+ })), (input.EncryptionContextSubset != null && {
4619
4628
  EncryptionContextSubset: serializeAws_json1_1EncryptionContextType(input.EncryptionContextSubset, context),
4620
4629
  }));
4621
4630
  };
@@ -4640,79 +4649,61 @@ var serializeAws_json1_1GrantTokenList = function (input, context) {
4640
4649
  });
4641
4650
  };
4642
4651
  var serializeAws_json1_1ImportKeyMaterialRequest = function (input, context) {
4643
- return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptedKeyMaterial !== undefined &&
4644
- input.EncryptedKeyMaterial !== null && {
4652
+ return __assign(__assign(__assign(__assign(__assign({}, (input.EncryptedKeyMaterial != null && {
4645
4653
  EncryptedKeyMaterial: context.base64Encoder(input.EncryptedKeyMaterial),
4646
- })), (input.ExpirationModel !== undefined &&
4647
- input.ExpirationModel !== null && { ExpirationModel: input.ExpirationModel })), (input.ImportToken !== undefined &&
4648
- input.ImportToken !== null && { ImportToken: context.base64Encoder(input.ImportToken) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.ValidTo !== undefined &&
4649
- input.ValidTo !== null && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }));
4654
+ })), (input.ExpirationModel != null && { ExpirationModel: input.ExpirationModel })), (input.ImportToken != null && { ImportToken: context.base64Encoder(input.ImportToken) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.ValidTo != null && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }));
4650
4655
  };
4651
4656
  var serializeAws_json1_1ListAliasesRequest = function (input, context) {
4652
- return __assign(__assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4657
+ return __assign(__assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4653
4658
  };
4654
4659
  var serializeAws_json1_1ListGrantsRequest = function (input, context) {
4655
- return __assign(__assign(__assign(__assign(__assign({}, (input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId })), (input.GranteePrincipal !== undefined &&
4656
- input.GranteePrincipal !== null && { GranteePrincipal: input.GranteePrincipal })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4660
+ return __assign(__assign(__assign(__assign(__assign({}, (input.GrantId != null && { GrantId: input.GrantId })), (input.GranteePrincipal != null && { GranteePrincipal: input.GranteePrincipal })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4657
4661
  };
4658
4662
  var serializeAws_json1_1ListKeyPoliciesRequest = function (input, context) {
4659
- return __assign(__assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4663
+ return __assign(__assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4660
4664
  };
4661
4665
  var serializeAws_json1_1ListKeysRequest = function (input, context) {
4662
- return __assign(__assign({}, (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4666
+ return __assign(__assign({}, (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4663
4667
  };
4664
4668
  var serializeAws_json1_1ListResourceTagsRequest = function (input, context) {
4665
- return __assign(__assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }));
4669
+ return __assign(__assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker }));
4666
4670
  };
4667
4671
  var serializeAws_json1_1ListRetirableGrantsRequest = function (input, context) {
4668
- return __assign(__assign(__assign({}, (input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit })), (input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker })), (input.RetiringPrincipal !== undefined &&
4669
- input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }));
4672
+ return __assign(__assign(__assign({}, (input.Limit != null && { Limit: input.Limit })), (input.Marker != null && { Marker: input.Marker })), (input.RetiringPrincipal != null && { RetiringPrincipal: input.RetiringPrincipal }));
4670
4673
  };
4671
4674
  var serializeAws_json1_1PutKeyPolicyRequest = function (input, context) {
4672
- return __assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck !== undefined &&
4673
- input.BypassPolicyLockoutSafetyCheck !== null && {
4675
+ return __assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck != null && {
4674
4676
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
4675
- })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy })), (input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }));
4677
+ })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Policy != null && { Policy: input.Policy })), (input.PolicyName != null && { PolicyName: input.PolicyName }));
4676
4678
  };
4677
4679
  var serializeAws_json1_1ReEncryptRequest = function (input, context) {
4678
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CiphertextBlob !== undefined &&
4679
- input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) })), (input.DestinationEncryptionAlgorithm !== undefined &&
4680
- input.DestinationEncryptionAlgorithm !== null && {
4680
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CiphertextBlob != null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) })), (input.DestinationEncryptionAlgorithm != null && {
4681
4681
  DestinationEncryptionAlgorithm: input.DestinationEncryptionAlgorithm,
4682
- })), (input.DestinationEncryptionContext !== undefined &&
4683
- input.DestinationEncryptionContext !== null && {
4682
+ })), (input.DestinationEncryptionContext != null && {
4684
4683
  DestinationEncryptionContext: serializeAws_json1_1EncryptionContextType(input.DestinationEncryptionContext, context),
4685
- })), (input.DestinationKeyId !== undefined &&
4686
- input.DestinationKeyId !== null && { DestinationKeyId: input.DestinationKeyId })), (input.GrantTokens !== undefined &&
4687
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.SourceEncryptionAlgorithm !== undefined &&
4688
- input.SourceEncryptionAlgorithm !== null && { SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm })), (input.SourceEncryptionContext !== undefined &&
4689
- input.SourceEncryptionContext !== null && {
4684
+ })), (input.DestinationKeyId != null && { DestinationKeyId: input.DestinationKeyId })), (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.SourceEncryptionAlgorithm != null && { SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm })), (input.SourceEncryptionContext != null && {
4690
4685
  SourceEncryptionContext: serializeAws_json1_1EncryptionContextType(input.SourceEncryptionContext, context),
4691
- })), (input.SourceKeyId !== undefined && input.SourceKeyId !== null && { SourceKeyId: input.SourceKeyId }));
4686
+ })), (input.SourceKeyId != null && { SourceKeyId: input.SourceKeyId }));
4692
4687
  };
4693
4688
  var serializeAws_json1_1ReplicateKeyRequest = function (input, context) {
4694
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck !== undefined &&
4695
- input.BypassPolicyLockoutSafetyCheck !== null && {
4689
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.BypassPolicyLockoutSafetyCheck != null && {
4696
4690
  BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
4697
- })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy })), (input.ReplicaRegion !== undefined && input.ReplicaRegion !== null && { ReplicaRegion: input.ReplicaRegion })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4691
+ })), (input.Description != null && { Description: input.Description })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Policy != null && { Policy: input.Policy })), (input.ReplicaRegion != null && { ReplicaRegion: input.ReplicaRegion })), (input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4698
4692
  };
4699
4693
  var serializeAws_json1_1RetireGrantRequest = function (input, context) {
4700
- return __assign(__assign(__assign({}, (input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId })), (input.GrantToken !== undefined && input.GrantToken !== null && { GrantToken: input.GrantToken })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4694
+ return __assign(__assign(__assign({}, (input.GrantId != null && { GrantId: input.GrantId })), (input.GrantToken != null && { GrantToken: input.GrantToken })), (input.KeyId != null && { KeyId: input.KeyId }));
4701
4695
  };
4702
4696
  var serializeAws_json1_1RevokeGrantRequest = function (input, context) {
4703
- return __assign(__assign({}, (input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4697
+ return __assign(__assign({}, (input.GrantId != null && { GrantId: input.GrantId })), (input.KeyId != null && { KeyId: input.KeyId }));
4704
4698
  };
4705
4699
  var serializeAws_json1_1ScheduleKeyDeletionRequest = function (input, context) {
4706
- return __assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.PendingWindowInDays !== undefined &&
4707
- input.PendingWindowInDays !== null && { PendingWindowInDays: input.PendingWindowInDays }));
4700
+ return __assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.PendingWindowInDays != null && { PendingWindowInDays: input.PendingWindowInDays }));
4708
4701
  };
4709
4702
  var serializeAws_json1_1SignRequest = function (input, context) {
4710
- return __assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens !== undefined &&
4711
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) })), (input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType })), (input.SigningAlgorithm !== undefined &&
4712
- input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }));
4703
+ return __assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Message != null && { Message: context.base64Encoder(input.Message) })), (input.MessageType != null && { MessageType: input.MessageType })), (input.SigningAlgorithm != null && { SigningAlgorithm: input.SigningAlgorithm }));
4713
4704
  };
4714
4705
  var serializeAws_json1_1Tag = function (input, context) {
4715
- return __assign(__assign({}, (input.TagKey !== undefined && input.TagKey !== null && { TagKey: input.TagKey })), (input.TagValue !== undefined && input.TagValue !== null && { TagValue: input.TagValue }));
4706
+ return __assign(__assign({}, (input.TagKey != null && { TagKey: input.TagKey })), (input.TagValue != null && { TagValue: input.TagValue }));
4716
4707
  };
4717
4708
  var serializeAws_json1_1TagKeyList = function (input, context) {
4718
4709
  return input
@@ -4735,37 +4726,28 @@ var serializeAws_json1_1TagList = function (input, context) {
4735
4726
  });
4736
4727
  };
4737
4728
  var serializeAws_json1_1TagResourceRequest = function (input, context) {
4738
- return __assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4729
+ return __assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
4739
4730
  };
4740
4731
  var serializeAws_json1_1UntagResourceRequest = function (input, context) {
4741
- return __assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.TagKeys !== undefined &&
4742
- input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }));
4732
+ return __assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }));
4743
4733
  };
4744
4734
  var serializeAws_json1_1UpdateAliasRequest = function (input, context) {
4745
- return __assign(__assign({}, (input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName })), (input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }));
4735
+ return __assign(__assign({}, (input.AliasName != null && { AliasName: input.AliasName })), (input.TargetKeyId != null && { TargetKeyId: input.TargetKeyId }));
4746
4736
  };
4747
4737
  var serializeAws_json1_1UpdateCustomKeyStoreRequest = function (input, context) {
4748
- return __assign(__assign(__assign(__assign({}, (input.CloudHsmClusterId !== undefined &&
4749
- input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId })), (input.CustomKeyStoreId !== undefined &&
4750
- input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.KeyStorePassword !== undefined &&
4751
- input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword })), (input.NewCustomKeyStoreName !== undefined &&
4752
- input.NewCustomKeyStoreName !== null && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }));
4738
+ return __assign(__assign(__assign(__assign({}, (input.CloudHsmClusterId != null && { CloudHsmClusterId: input.CloudHsmClusterId })), (input.CustomKeyStoreId != null && { CustomKeyStoreId: input.CustomKeyStoreId })), (input.KeyStorePassword != null && { KeyStorePassword: input.KeyStorePassword })), (input.NewCustomKeyStoreName != null && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }));
4753
4739
  };
4754
4740
  var serializeAws_json1_1UpdateKeyDescriptionRequest = function (input, context) {
4755
- return __assign(__assign({}, (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }));
4741
+ return __assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.KeyId != null && { KeyId: input.KeyId }));
4756
4742
  };
4757
4743
  var serializeAws_json1_1UpdatePrimaryRegionRequest = function (input, context) {
4758
- return __assign(__assign({}, (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.PrimaryRegion !== undefined && input.PrimaryRegion !== null && { PrimaryRegion: input.PrimaryRegion }));
4744
+ return __assign(__assign({}, (input.KeyId != null && { KeyId: input.KeyId })), (input.PrimaryRegion != null && { PrimaryRegion: input.PrimaryRegion }));
4759
4745
  };
4760
4746
  var serializeAws_json1_1VerifyMacRequest = function (input, context) {
4761
- return __assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens !== undefined &&
4762
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Mac !== undefined && input.Mac !== null && { Mac: context.base64Encoder(input.Mac) })), (input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm })), (input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }));
4747
+ return __assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Mac != null && { Mac: context.base64Encoder(input.Mac) })), (input.MacAlgorithm != null && { MacAlgorithm: input.MacAlgorithm })), (input.Message != null && { Message: context.base64Encoder(input.Message) }));
4763
4748
  };
4764
4749
  var serializeAws_json1_1VerifyRequest = function (input, context) {
4765
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens !== undefined &&
4766
- input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId })), (input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) })), (input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType })), (input.Signature !== undefined &&
4767
- input.Signature !== null && { Signature: context.base64Encoder(input.Signature) })), (input.SigningAlgorithm !== undefined &&
4768
- input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }));
4750
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.GrantTokens != null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) })), (input.KeyId != null && { KeyId: input.KeyId })), (input.Message != null && { Message: context.base64Encoder(input.Message) })), (input.MessageType != null && { MessageType: input.MessageType })), (input.Signature != null && { Signature: context.base64Encoder(input.Signature) })), (input.SigningAlgorithm != null && { SigningAlgorithm: input.SigningAlgorithm }));
4769
4751
  };
4770
4752
  var deserializeAws_json1_1AliasList = function (output, context) {
4771
4753
  var retVal = (output || [])
@@ -4782,10 +4764,10 @@ var deserializeAws_json1_1AliasListEntry = function (output, context) {
4782
4764
  return {
4783
4765
  AliasArn: __expectString(output.AliasArn),
4784
4766
  AliasName: __expectString(output.AliasName),
4785
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
4767
+ CreationDate: output.CreationDate != null
4786
4768
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
4787
4769
  : undefined,
4788
- LastUpdatedDate: output.LastUpdatedDate !== undefined && output.LastUpdatedDate !== null
4770
+ LastUpdatedDate: output.LastUpdatedDate != null
4789
4771
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedDate)))
4790
4772
  : undefined,
4791
4773
  TargetKeyId: __expectString(output.TargetKeyId),
@@ -4842,9 +4824,7 @@ var deserializeAws_json1_1CreateGrantResponse = function (output, context) {
4842
4824
  };
4843
4825
  var deserializeAws_json1_1CreateKeyResponse = function (output, context) {
4844
4826
  return {
4845
- KeyMetadata: output.KeyMetadata !== undefined && output.KeyMetadata !== null
4846
- ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context)
4847
- : undefined,
4827
+ KeyMetadata: output.KeyMetadata != null ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context) : undefined,
4848
4828
  };
4849
4829
  };
4850
4830
  var deserializeAws_json1_1CustomKeyStoreHasCMKsException = function (output, context) {
@@ -4883,7 +4863,7 @@ var deserializeAws_json1_1CustomKeyStoresListEntry = function (output, context)
4883
4863
  CloudHsmClusterId: __expectString(output.CloudHsmClusterId),
4884
4864
  ConnectionErrorCode: __expectString(output.ConnectionErrorCode),
4885
4865
  ConnectionState: __expectString(output.ConnectionState),
4886
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
4866
+ CreationDate: output.CreationDate != null
4887
4867
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
4888
4868
  : undefined,
4889
4869
  CustomKeyStoreId: __expectString(output.CustomKeyStoreId),
@@ -4895,7 +4875,7 @@ var deserializeAws_json1_1DecryptResponse = function (output, context) {
4895
4875
  return {
4896
4876
  EncryptionAlgorithm: __expectString(output.EncryptionAlgorithm),
4897
4877
  KeyId: __expectString(output.KeyId),
4898
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4878
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
4899
4879
  };
4900
4880
  };
4901
4881
  var deserializeAws_json1_1DeleteCustomKeyStoreResponse = function (output, context) {
@@ -4908,7 +4888,7 @@ var deserializeAws_json1_1DependencyTimeoutException = function (output, context
4908
4888
  };
4909
4889
  var deserializeAws_json1_1DescribeCustomKeyStoresResponse = function (output, context) {
4910
4890
  return {
4911
- CustomKeyStores: output.CustomKeyStores !== undefined && output.CustomKeyStores !== null
4891
+ CustomKeyStores: output.CustomKeyStores != null
4912
4892
  ? deserializeAws_json1_1CustomKeyStoresList(output.CustomKeyStores, context)
4913
4893
  : undefined,
4914
4894
  NextMarker: __expectString(output.NextMarker),
@@ -4917,9 +4897,7 @@ var deserializeAws_json1_1DescribeCustomKeyStoresResponse = function (output, co
4917
4897
  };
4918
4898
  var deserializeAws_json1_1DescribeKeyResponse = function (output, context) {
4919
4899
  return {
4920
- KeyMetadata: output.KeyMetadata !== undefined && output.KeyMetadata !== null
4921
- ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context)
4922
- : undefined,
4900
+ KeyMetadata: output.KeyMetadata != null ? deserializeAws_json1_1KeyMetadata(output.KeyMetadata, context) : undefined,
4923
4901
  };
4924
4902
  };
4925
4903
  var deserializeAws_json1_1DisabledException = function (output, context) {
@@ -4953,9 +4931,7 @@ var deserializeAws_json1_1EncryptionContextType = function (output, context) {
4953
4931
  };
4954
4932
  var deserializeAws_json1_1EncryptResponse = function (output, context) {
4955
4933
  return {
4956
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4957
- ? context.base64Decoder(output.CiphertextBlob)
4958
- : undefined,
4934
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4959
4935
  EncryptionAlgorithm: __expectString(output.EncryptionAlgorithm),
4960
4936
  KeyId: __expectString(output.KeyId),
4961
4937
  };
@@ -4969,52 +4945,42 @@ var deserializeAws_json1_1GenerateDataKeyPairResponse = function (output, contex
4969
4945
  return {
4970
4946
  KeyId: __expectString(output.KeyId),
4971
4947
  KeyPairSpec: __expectString(output.KeyPairSpec),
4972
- PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob !== undefined && output.PrivateKeyCiphertextBlob !== null
4973
- ? context.base64Decoder(output.PrivateKeyCiphertextBlob)
4974
- : undefined,
4975
- PrivateKeyPlaintext: output.PrivateKeyPlaintext !== undefined && output.PrivateKeyPlaintext !== null
4976
- ? context.base64Decoder(output.PrivateKeyPlaintext)
4977
- : undefined,
4978
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4948
+ PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob != null ? context.base64Decoder(output.PrivateKeyCiphertextBlob) : undefined,
4949
+ PrivateKeyPlaintext: output.PrivateKeyPlaintext != null ? context.base64Decoder(output.PrivateKeyPlaintext) : undefined,
4950
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4979
4951
  };
4980
4952
  };
4981
4953
  var deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextResponse = function (output, context) {
4982
4954
  return {
4983
4955
  KeyId: __expectString(output.KeyId),
4984
4956
  KeyPairSpec: __expectString(output.KeyPairSpec),
4985
- PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob !== undefined && output.PrivateKeyCiphertextBlob !== null
4986
- ? context.base64Decoder(output.PrivateKeyCiphertextBlob)
4987
- : undefined,
4988
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
4957
+ PrivateKeyCiphertextBlob: output.PrivateKeyCiphertextBlob != null ? context.base64Decoder(output.PrivateKeyCiphertextBlob) : undefined,
4958
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
4989
4959
  };
4990
4960
  };
4991
4961
  var deserializeAws_json1_1GenerateDataKeyResponse = function (output, context) {
4992
4962
  return {
4993
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
4994
- ? context.base64Decoder(output.CiphertextBlob)
4995
- : undefined,
4963
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
4996
4964
  KeyId: __expectString(output.KeyId),
4997
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4965
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
4998
4966
  };
4999
4967
  };
5000
4968
  var deserializeAws_json1_1GenerateDataKeyWithoutPlaintextResponse = function (output, context) {
5001
4969
  return {
5002
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
5003
- ? context.base64Decoder(output.CiphertextBlob)
5004
- : undefined,
4970
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
5005
4971
  KeyId: __expectString(output.KeyId),
5006
4972
  };
5007
4973
  };
5008
4974
  var deserializeAws_json1_1GenerateMacResponse = function (output, context) {
5009
4975
  return {
5010
4976
  KeyId: __expectString(output.KeyId),
5011
- Mac: output.Mac !== undefined && output.Mac !== null ? context.base64Decoder(output.Mac) : undefined,
4977
+ Mac: output.Mac != null ? context.base64Decoder(output.Mac) : undefined,
5012
4978
  MacAlgorithm: __expectString(output.MacAlgorithm),
5013
4979
  };
5014
4980
  };
5015
4981
  var deserializeAws_json1_1GenerateRandomResponse = function (output, context) {
5016
4982
  return {
5017
- Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
4983
+ Plaintext: output.Plaintext != null ? context.base64Decoder(output.Plaintext) : undefined,
5018
4984
  };
5019
4985
  };
5020
4986
  var deserializeAws_json1_1GetKeyPolicyResponse = function (output, context) {
@@ -5029,37 +4995,35 @@ var deserializeAws_json1_1GetKeyRotationStatusResponse = function (output, conte
5029
4995
  };
5030
4996
  var deserializeAws_json1_1GetParametersForImportResponse = function (output, context) {
5031
4997
  return {
5032
- ImportToken: output.ImportToken !== undefined && output.ImportToken !== null
5033
- ? context.base64Decoder(output.ImportToken)
5034
- : undefined,
4998
+ ImportToken: output.ImportToken != null ? context.base64Decoder(output.ImportToken) : undefined,
5035
4999
  KeyId: __expectString(output.KeyId),
5036
- ParametersValidTo: output.ParametersValidTo !== undefined && output.ParametersValidTo !== null
5000
+ ParametersValidTo: output.ParametersValidTo != null
5037
5001
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ParametersValidTo)))
5038
5002
  : undefined,
5039
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
5003
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
5040
5004
  };
5041
5005
  };
5042
5006
  var deserializeAws_json1_1GetPublicKeyResponse = function (output, context) {
5043
5007
  return {
5044
5008
  CustomerMasterKeySpec: __expectString(output.CustomerMasterKeySpec),
5045
- EncryptionAlgorithms: output.EncryptionAlgorithms !== undefined && output.EncryptionAlgorithms !== null
5009
+ EncryptionAlgorithms: output.EncryptionAlgorithms != null
5046
5010
  ? deserializeAws_json1_1EncryptionAlgorithmSpecList(output.EncryptionAlgorithms, context)
5047
5011
  : undefined,
5048
5012
  KeyId: __expectString(output.KeyId),
5049
5013
  KeySpec: __expectString(output.KeySpec),
5050
5014
  KeyUsage: __expectString(output.KeyUsage),
5051
- PublicKey: output.PublicKey !== undefined && output.PublicKey !== null ? context.base64Decoder(output.PublicKey) : undefined,
5052
- SigningAlgorithms: output.SigningAlgorithms !== undefined && output.SigningAlgorithms !== null
5015
+ PublicKey: output.PublicKey != null ? context.base64Decoder(output.PublicKey) : undefined,
5016
+ SigningAlgorithms: output.SigningAlgorithms != null
5053
5017
  ? deserializeAws_json1_1SigningAlgorithmSpecList(output.SigningAlgorithms, context)
5054
5018
  : undefined,
5055
5019
  };
5056
5020
  };
5057
5021
  var deserializeAws_json1_1GrantConstraints = function (output, context) {
5058
5022
  return {
5059
- EncryptionContextEquals: output.EncryptionContextEquals !== undefined && output.EncryptionContextEquals !== null
5023
+ EncryptionContextEquals: output.EncryptionContextEquals != null
5060
5024
  ? deserializeAws_json1_1EncryptionContextType(output.EncryptionContextEquals, context)
5061
5025
  : undefined,
5062
- EncryptionContextSubset: output.EncryptionContextSubset !== undefined && output.EncryptionContextSubset !== null
5026
+ EncryptionContextSubset: output.EncryptionContextSubset != null
5063
5027
  ? deserializeAws_json1_1EncryptionContextType(output.EncryptionContextSubset, context)
5064
5028
  : undefined,
5065
5029
  };
@@ -5077,10 +5041,8 @@ var deserializeAws_json1_1GrantList = function (output, context) {
5077
5041
  };
5078
5042
  var deserializeAws_json1_1GrantListEntry = function (output, context) {
5079
5043
  return {
5080
- Constraints: output.Constraints !== undefined && output.Constraints !== null
5081
- ? deserializeAws_json1_1GrantConstraints(output.Constraints, context)
5082
- : undefined,
5083
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
5044
+ Constraints: output.Constraints != null ? deserializeAws_json1_1GrantConstraints(output.Constraints, context) : undefined,
5045
+ CreationDate: output.CreationDate != null
5084
5046
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
5085
5047
  : undefined,
5086
5048
  GrantId: __expectString(output.GrantId),
@@ -5088,9 +5050,7 @@ var deserializeAws_json1_1GrantListEntry = function (output, context) {
5088
5050
  IssuingAccount: __expectString(output.IssuingAccount),
5089
5051
  KeyId: __expectString(output.KeyId),
5090
5052
  Name: __expectString(output.Name),
5091
- Operations: output.Operations !== undefined && output.Operations !== null
5092
- ? deserializeAws_json1_1GrantOperationList(output.Operations, context)
5093
- : undefined,
5053
+ Operations: output.Operations != null ? deserializeAws_json1_1GrantOperationList(output.Operations, context) : undefined,
5094
5054
  RetiringPrincipal: __expectString(output.RetiringPrincipal),
5095
5055
  };
5096
5056
  };
@@ -5185,17 +5145,17 @@ var deserializeAws_json1_1KeyMetadata = function (output, context) {
5185
5145
  AWSAccountId: __expectString(output.AWSAccountId),
5186
5146
  Arn: __expectString(output.Arn),
5187
5147
  CloudHsmClusterId: __expectString(output.CloudHsmClusterId),
5188
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
5148
+ CreationDate: output.CreationDate != null
5189
5149
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
5190
5150
  : undefined,
5191
5151
  CustomKeyStoreId: __expectString(output.CustomKeyStoreId),
5192
5152
  CustomerMasterKeySpec: __expectString(output.CustomerMasterKeySpec),
5193
- DeletionDate: output.DeletionDate !== undefined && output.DeletionDate !== null
5153
+ DeletionDate: output.DeletionDate != null
5194
5154
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DeletionDate)))
5195
5155
  : undefined,
5196
5156
  Description: __expectString(output.Description),
5197
5157
  Enabled: __expectBoolean(output.Enabled),
5198
- EncryptionAlgorithms: output.EncryptionAlgorithms !== undefined && output.EncryptionAlgorithms !== null
5158
+ EncryptionAlgorithms: output.EncryptionAlgorithms != null
5199
5159
  ? deserializeAws_json1_1EncryptionAlgorithmSpecList(output.EncryptionAlgorithms, context)
5200
5160
  : undefined,
5201
5161
  ExpirationModel: __expectString(output.ExpirationModel),
@@ -5204,21 +5164,19 @@ var deserializeAws_json1_1KeyMetadata = function (output, context) {
5204
5164
  KeySpec: __expectString(output.KeySpec),
5205
5165
  KeyState: __expectString(output.KeyState),
5206
5166
  KeyUsage: __expectString(output.KeyUsage),
5207
- MacAlgorithms: output.MacAlgorithms !== undefined && output.MacAlgorithms !== null
5167
+ MacAlgorithms: output.MacAlgorithms != null
5208
5168
  ? deserializeAws_json1_1MacAlgorithmSpecList(output.MacAlgorithms, context)
5209
5169
  : undefined,
5210
5170
  MultiRegion: __expectBoolean(output.MultiRegion),
5211
- MultiRegionConfiguration: output.MultiRegionConfiguration !== undefined && output.MultiRegionConfiguration !== null
5171
+ MultiRegionConfiguration: output.MultiRegionConfiguration != null
5212
5172
  ? deserializeAws_json1_1MultiRegionConfiguration(output.MultiRegionConfiguration, context)
5213
5173
  : undefined,
5214
5174
  Origin: __expectString(output.Origin),
5215
5175
  PendingDeletionWindowInDays: __expectInt32(output.PendingDeletionWindowInDays),
5216
- SigningAlgorithms: output.SigningAlgorithms !== undefined && output.SigningAlgorithms !== null
5176
+ SigningAlgorithms: output.SigningAlgorithms != null
5217
5177
  ? deserializeAws_json1_1SigningAlgorithmSpecList(output.SigningAlgorithms, context)
5218
5178
  : undefined,
5219
- ValidTo: output.ValidTo !== undefined && output.ValidTo !== null
5220
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ValidTo)))
5221
- : undefined,
5179
+ ValidTo: output.ValidTo != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ValidTo))) : undefined,
5222
5180
  };
5223
5181
  };
5224
5182
  var deserializeAws_json1_1KeyUnavailableException = function (output, context) {
@@ -5253,18 +5211,14 @@ var deserializeAws_json1_1LimitExceededException = function (output, context) {
5253
5211
  };
5254
5212
  var deserializeAws_json1_1ListAliasesResponse = function (output, context) {
5255
5213
  return {
5256
- Aliases: output.Aliases !== undefined && output.Aliases !== null
5257
- ? deserializeAws_json1_1AliasList(output.Aliases, context)
5258
- : undefined,
5214
+ Aliases: output.Aliases != null ? deserializeAws_json1_1AliasList(output.Aliases, context) : undefined,
5259
5215
  NextMarker: __expectString(output.NextMarker),
5260
5216
  Truncated: __expectBoolean(output.Truncated),
5261
5217
  };
5262
5218
  };
5263
5219
  var deserializeAws_json1_1ListGrantsResponse = function (output, context) {
5264
5220
  return {
5265
- Grants: output.Grants !== undefined && output.Grants !== null
5266
- ? deserializeAws_json1_1GrantList(output.Grants, context)
5267
- : undefined,
5221
+ Grants: output.Grants != null ? deserializeAws_json1_1GrantList(output.Grants, context) : undefined,
5268
5222
  NextMarker: __expectString(output.NextMarker),
5269
5223
  Truncated: __expectBoolean(output.Truncated),
5270
5224
  };
@@ -5272,17 +5226,13 @@ var deserializeAws_json1_1ListGrantsResponse = function (output, context) {
5272
5226
  var deserializeAws_json1_1ListKeyPoliciesResponse = function (output, context) {
5273
5227
  return {
5274
5228
  NextMarker: __expectString(output.NextMarker),
5275
- PolicyNames: output.PolicyNames !== undefined && output.PolicyNames !== null
5276
- ? deserializeAws_json1_1PolicyNameList(output.PolicyNames, context)
5277
- : undefined,
5229
+ PolicyNames: output.PolicyNames != null ? deserializeAws_json1_1PolicyNameList(output.PolicyNames, context) : undefined,
5278
5230
  Truncated: __expectBoolean(output.Truncated),
5279
5231
  };
5280
5232
  };
5281
5233
  var deserializeAws_json1_1ListKeysResponse = function (output, context) {
5282
5234
  return {
5283
- Keys: output.Keys !== undefined && output.Keys !== null
5284
- ? deserializeAws_json1_1KeyList(output.Keys, context)
5285
- : undefined,
5235
+ Keys: output.Keys != null ? deserializeAws_json1_1KeyList(output.Keys, context) : undefined,
5286
5236
  NextMarker: __expectString(output.NextMarker),
5287
5237
  Truncated: __expectBoolean(output.Truncated),
5288
5238
  };
@@ -5290,9 +5240,7 @@ var deserializeAws_json1_1ListKeysResponse = function (output, context) {
5290
5240
  var deserializeAws_json1_1ListResourceTagsResponse = function (output, context) {
5291
5241
  return {
5292
5242
  NextMarker: __expectString(output.NextMarker),
5293
- Tags: output.Tags !== undefined && output.Tags !== null
5294
- ? deserializeAws_json1_1TagList(output.Tags, context)
5295
- : undefined,
5243
+ Tags: output.Tags != null ? deserializeAws_json1_1TagList(output.Tags, context) : undefined,
5296
5244
  Truncated: __expectBoolean(output.Truncated),
5297
5245
  };
5298
5246
  };
@@ -5315,12 +5263,8 @@ var deserializeAws_json1_1MalformedPolicyDocumentException = function (output, c
5315
5263
  var deserializeAws_json1_1MultiRegionConfiguration = function (output, context) {
5316
5264
  return {
5317
5265
  MultiRegionKeyType: __expectString(output.MultiRegionKeyType),
5318
- PrimaryKey: output.PrimaryKey !== undefined && output.PrimaryKey !== null
5319
- ? deserializeAws_json1_1MultiRegionKey(output.PrimaryKey, context)
5320
- : undefined,
5321
- ReplicaKeys: output.ReplicaKeys !== undefined && output.ReplicaKeys !== null
5322
- ? deserializeAws_json1_1MultiRegionKeyList(output.ReplicaKeys, context)
5323
- : undefined,
5266
+ PrimaryKey: output.PrimaryKey != null ? deserializeAws_json1_1MultiRegionKey(output.PrimaryKey, context) : undefined,
5267
+ ReplicaKeys: output.ReplicaKeys != null ? deserializeAws_json1_1MultiRegionKeyList(output.ReplicaKeys, context) : undefined,
5324
5268
  };
5325
5269
  };
5326
5270
  var deserializeAws_json1_1MultiRegionKey = function (output, context) {
@@ -5358,9 +5302,7 @@ var deserializeAws_json1_1PolicyNameList = function (output, context) {
5358
5302
  };
5359
5303
  var deserializeAws_json1_1ReEncryptResponse = function (output, context) {
5360
5304
  return {
5361
- CiphertextBlob: output.CiphertextBlob !== undefined && output.CiphertextBlob !== null
5362
- ? context.base64Decoder(output.CiphertextBlob)
5363
- : undefined,
5305
+ CiphertextBlob: output.CiphertextBlob != null ? context.base64Decoder(output.CiphertextBlob) : undefined,
5364
5306
  DestinationEncryptionAlgorithm: __expectString(output.DestinationEncryptionAlgorithm),
5365
5307
  KeyId: __expectString(output.KeyId),
5366
5308
  SourceEncryptionAlgorithm: __expectString(output.SourceEncryptionAlgorithm),
@@ -5369,18 +5311,16 @@ var deserializeAws_json1_1ReEncryptResponse = function (output, context) {
5369
5311
  };
5370
5312
  var deserializeAws_json1_1ReplicateKeyResponse = function (output, context) {
5371
5313
  return {
5372
- ReplicaKeyMetadata: output.ReplicaKeyMetadata !== undefined && output.ReplicaKeyMetadata !== null
5314
+ ReplicaKeyMetadata: output.ReplicaKeyMetadata != null
5373
5315
  ? deserializeAws_json1_1KeyMetadata(output.ReplicaKeyMetadata, context)
5374
5316
  : undefined,
5375
5317
  ReplicaPolicy: __expectString(output.ReplicaPolicy),
5376
- ReplicaTags: output.ReplicaTags !== undefined && output.ReplicaTags !== null
5377
- ? deserializeAws_json1_1TagList(output.ReplicaTags, context)
5378
- : undefined,
5318
+ ReplicaTags: output.ReplicaTags != null ? deserializeAws_json1_1TagList(output.ReplicaTags, context) : undefined,
5379
5319
  };
5380
5320
  };
5381
5321
  var deserializeAws_json1_1ScheduleKeyDeletionResponse = function (output, context) {
5382
5322
  return {
5383
- DeletionDate: output.DeletionDate !== undefined && output.DeletionDate !== null
5323
+ DeletionDate: output.DeletionDate != null
5384
5324
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DeletionDate)))
5385
5325
  : undefined,
5386
5326
  KeyId: __expectString(output.KeyId),
@@ -5402,7 +5342,7 @@ var deserializeAws_json1_1SigningAlgorithmSpecList = function (output, context)
5402
5342
  var deserializeAws_json1_1SignResponse = function (output, context) {
5403
5343
  return {
5404
5344
  KeyId: __expectString(output.KeyId),
5405
- Signature: output.Signature !== undefined && output.Signature !== null ? context.base64Decoder(output.Signature) : undefined,
5345
+ Signature: output.Signature != null ? context.base64Decoder(output.Signature) : undefined,
5406
5346
  SigningAlgorithm: __expectString(output.SigningAlgorithm),
5407
5347
  };
5408
5348
  };
@@ -5524,5 +5464,4 @@ var loadRestJsonErrorCode = function (output, data) {
5524
5464
  if (data["__type"] !== undefined) {
5525
5465
  return sanitizeErrorCode(data["__type"]);
5526
5466
  }
5527
- return "";
5528
5467
  };