@aws-sdk/client-ssm-incidents 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AccessDeniedException, Action, AttributeValueList, ChatChannel, Condition, ConflictException, DynamicSsmParameterValue, InternalServerException, ItemValue, NotificationTargetItem, RelatedItemsUpdate, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, UpdateReplicationSetAction, ValidationException, } from "../models/models_0";
6
6
  import { SSMIncidentsServiceException as __BaseException } from "../models/SSMIncidentsServiceException";
@@ -114,7 +114,9 @@ export var serializeAws_restJson1DeleteReplicationSetCommand = function (input,
114
114
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
115
115
  headers = {};
116
116
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/deleteReplicationSet";
117
- query = __assign({}, (input.arn !== undefined && { arn: input.arn }));
117
+ query = map({
118
+ arn: [, input.arn],
119
+ });
118
120
  return [2, new __HttpRequest({
119
121
  protocol: protocol,
120
122
  hostname: hostname,
@@ -209,7 +211,9 @@ export var serializeAws_restJson1GetIncidentRecordCommand = function (input, con
209
211
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
210
212
  headers = {};
211
213
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getIncidentRecord";
212
- query = __assign({}, (input.arn !== undefined && { arn: input.arn }));
214
+ query = map({
215
+ arn: [, input.arn],
216
+ });
213
217
  return [2, new __HttpRequest({
214
218
  protocol: protocol,
215
219
  hostname: hostname,
@@ -232,7 +236,9 @@ export var serializeAws_restJson1GetReplicationSetCommand = function (input, con
232
236
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
233
237
  headers = {};
234
238
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getReplicationSet";
235
- query = __assign({}, (input.arn !== undefined && { arn: input.arn }));
239
+ query = map({
240
+ arn: [, input.arn],
241
+ });
236
242
  return [2, new __HttpRequest({
237
243
  protocol: protocol,
238
244
  hostname: hostname,
@@ -257,7 +263,9 @@ export var serializeAws_restJson1GetResourcePoliciesCommand = function (input, c
257
263
  "content-type": "application/json",
258
264
  };
259
265
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getResourcePolicies";
260
- query = __assign({}, (input.resourceArn !== undefined && { resourceArn: input.resourceArn }));
266
+ query = map({
267
+ resourceArn: [, input.resourceArn],
268
+ });
261
269
  body = JSON.stringify(__assign(__assign({}, (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
262
270
  return [2, new __HttpRequest({
263
271
  protocol: protocol,
@@ -281,7 +289,9 @@ export var serializeAws_restJson1GetResponsePlanCommand = function (input, conte
281
289
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
282
290
  headers = {};
283
291
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getResponsePlan";
284
- query = __assign({}, (input.arn !== undefined && { arn: input.arn }));
292
+ query = map({
293
+ arn: [, input.arn],
294
+ });
285
295
  return [2, new __HttpRequest({
286
296
  protocol: protocol,
287
297
  hostname: hostname,
@@ -304,7 +314,10 @@ export var serializeAws_restJson1GetTimelineEventCommand = function (input, cont
304
314
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
305
315
  headers = {};
306
316
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getTimelineEvent";
307
- query = __assign(__assign({}, (input.incidentRecordArn !== undefined && { incidentRecordArn: input.incidentRecordArn })), (input.eventId !== undefined && { eventId: input.eventId }));
317
+ query = map({
318
+ incidentRecordArn: [, input.incidentRecordArn],
319
+ eventId: [, input.eventId],
320
+ });
308
321
  return [2, new __HttpRequest({
309
322
  protocol: protocol,
310
323
  hostname: hostname,
@@ -415,7 +428,7 @@ export var serializeAws_restJson1ListResponsePlansCommand = function (input, con
415
428
  });
416
429
  }); };
417
430
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
418
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
431
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
419
432
  return __generator(this, function (_c) {
420
433
  switch (_c.label) {
421
434
  case 0: return [4, context.endpoint()];
@@ -423,16 +436,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
423
436
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
424
437
  headers = {};
425
438
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
426
- if (input.resourceArn !== undefined) {
427
- labelValue = input.resourceArn;
428
- if (labelValue.length <= 0) {
429
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
430
- }
431
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
432
- }
433
- else {
434
- throw new Error("No value provided for input HTTP label: resourceArn.");
435
- }
439
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
436
440
  return [2, new __HttpRequest({
437
441
  protocol: protocol,
438
442
  hostname: hostname,
@@ -523,7 +527,7 @@ export var serializeAws_restJson1StartIncidentCommand = function (input, context
523
527
  });
524
528
  }); };
525
529
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
526
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
530
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
527
531
  return __generator(this, function (_c) {
528
532
  switch (_c.label) {
529
533
  case 0: return [4, context.endpoint()];
@@ -533,16 +537,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
533
537
  "content-type": "application/json",
534
538
  };
535
539
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
536
- if (input.resourceArn !== undefined) {
537
- labelValue = input.resourceArn;
538
- if (labelValue.length <= 0) {
539
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
540
- }
541
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
542
- }
543
- else {
544
- throw new Error("No value provided for input HTTP label: resourceArn.");
545
- }
540
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
546
541
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
547
542
  return [2, new __HttpRequest({
548
543
  protocol: protocol,
@@ -557,7 +552,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
557
552
  });
558
553
  }); };
559
554
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
560
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
555
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
561
556
  return __generator(this, function (_c) {
562
557
  switch (_c.label) {
563
558
  case 0: return [4, context.endpoint()];
@@ -565,17 +560,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
565
560
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
566
561
  headers = {};
567
562
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
568
- if (input.resourceArn !== undefined) {
569
- labelValue = input.resourceArn;
570
- if (labelValue.length <= 0) {
571
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
572
- }
573
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
574
- }
575
- else {
576
- throw new Error("No value provided for input HTTP label: resourceArn.");
577
- }
578
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
563
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
564
+ query = map({
565
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
566
+ });
579
567
  return [2, new __HttpRequest({
580
568
  protocol: protocol,
581
569
  hostname: hostname,
@@ -757,24 +745,23 @@ export var deserializeAws_restJson1CreateReplicationSetCommand = function (outpu
757
745
  if (output.statusCode !== 201 && output.statusCode >= 300) {
758
746
  return [2, deserializeAws_restJson1CreateReplicationSetCommandError(output, context)];
759
747
  }
760
- contents = {
748
+ contents = map({
761
749
  $metadata: deserializeMetadata(output),
762
- arn: undefined,
763
- };
750
+ });
764
751
  _a = __expectNonNull;
765
752
  _b = __expectObject;
766
753
  return [4, parseBody(output.body, context)];
767
754
  case 1:
768
755
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
769
- if (data.arn !== undefined && data.arn !== null) {
756
+ if (data.arn != null) {
770
757
  contents.arn = __expectString(data.arn);
771
758
  }
772
- return [2, Promise.resolve(contents)];
759
+ return [2, contents];
773
760
  }
774
761
  });
775
762
  }); };
776
763
  var deserializeAws_restJson1CreateReplicationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
777
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
764
+ var parsedOutput, _a, errorCode, _b, parsedBody;
778
765
  var _c;
779
766
  return __generator(this, function (_d) {
780
767
  switch (_d.label) {
@@ -815,14 +802,14 @@ var deserializeAws_restJson1CreateReplicationSetCommandError = function (output,
815
802
  case 13: throw _d.sent();
816
803
  case 14:
817
804
  parsedBody = parsedOutput.body;
818
- $metadata = deserializeMetadata(output);
819
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
820
- response = new __BaseException({
821
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
822
- $fault: "client",
823
- $metadata: $metadata,
805
+ throwDefaultError({
806
+ output: output,
807
+ parsedBody: parsedBody,
808
+ exceptionCtor: __BaseException,
809
+ errorCode: errorCode,
824
810
  });
825
- throw __decorateServiceException(response, parsedBody);
811
+ _d.label = 15;
812
+ case 15: return [2];
826
813
  }
827
814
  });
828
815
  }); };
@@ -834,24 +821,23 @@ export var deserializeAws_restJson1CreateResponsePlanCommand = function (output,
834
821
  if (output.statusCode !== 201 && output.statusCode >= 300) {
835
822
  return [2, deserializeAws_restJson1CreateResponsePlanCommandError(output, context)];
836
823
  }
837
- contents = {
824
+ contents = map({
838
825
  $metadata: deserializeMetadata(output),
839
- arn: undefined,
840
- };
826
+ });
841
827
  _a = __expectNonNull;
842
828
  _b = __expectObject;
843
829
  return [4, parseBody(output.body, context)];
844
830
  case 1:
845
831
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
846
- if (data.arn !== undefined && data.arn !== null) {
832
+ if (data.arn != null) {
847
833
  contents.arn = __expectString(data.arn);
848
834
  }
849
- return [2, Promise.resolve(contents)];
835
+ return [2, contents];
850
836
  }
851
837
  });
852
838
  }); };
853
839
  var deserializeAws_restJson1CreateResponsePlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
854
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
840
+ var parsedOutput, _a, errorCode, _b, parsedBody;
855
841
  var _c;
856
842
  return __generator(this, function (_d) {
857
843
  switch (_d.label) {
@@ -892,14 +878,14 @@ var deserializeAws_restJson1CreateResponsePlanCommandError = function (output, c
892
878
  case 13: throw _d.sent();
893
879
  case 14:
894
880
  parsedBody = parsedOutput.body;
895
- $metadata = deserializeMetadata(output);
896
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
897
- response = new __BaseException({
898
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
899
- $fault: "client",
900
- $metadata: $metadata,
881
+ throwDefaultError({
882
+ output: output,
883
+ parsedBody: parsedBody,
884
+ exceptionCtor: __BaseException,
885
+ errorCode: errorCode,
901
886
  });
902
- throw __decorateServiceException(response, parsedBody);
887
+ _d.label = 15;
888
+ case 15: return [2];
903
889
  }
904
890
  });
905
891
  }); };
@@ -911,28 +897,26 @@ export var deserializeAws_restJson1CreateTimelineEventCommand = function (output
911
897
  if (output.statusCode !== 201 && output.statusCode >= 300) {
912
898
  return [2, deserializeAws_restJson1CreateTimelineEventCommandError(output, context)];
913
899
  }
914
- contents = {
900
+ contents = map({
915
901
  $metadata: deserializeMetadata(output),
916
- eventId: undefined,
917
- incidentRecordArn: undefined,
918
- };
902
+ });
919
903
  _a = __expectNonNull;
920
904
  _b = __expectObject;
921
905
  return [4, parseBody(output.body, context)];
922
906
  case 1:
923
907
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
924
- if (data.eventId !== undefined && data.eventId !== null) {
908
+ if (data.eventId != null) {
925
909
  contents.eventId = __expectString(data.eventId);
926
910
  }
927
- if (data.incidentRecordArn !== undefined && data.incidentRecordArn !== null) {
911
+ if (data.incidentRecordArn != null) {
928
912
  contents.incidentRecordArn = __expectString(data.incidentRecordArn);
929
913
  }
930
- return [2, Promise.resolve(contents)];
914
+ return [2, contents];
931
915
  }
932
916
  });
933
917
  }); };
934
918
  var deserializeAws_restJson1CreateTimelineEventCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
935
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
919
+ var parsedOutput, _a, errorCode, _b, parsedBody;
936
920
  var _c;
937
921
  return __generator(this, function (_d) {
938
922
  switch (_d.label) {
@@ -973,14 +957,14 @@ var deserializeAws_restJson1CreateTimelineEventCommandError = function (output,
973
957
  case 13: throw _d.sent();
974
958
  case 14:
975
959
  parsedBody = parsedOutput.body;
976
- $metadata = deserializeMetadata(output);
977
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
978
- response = new __BaseException({
979
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
980
- $fault: "client",
981
- $metadata: $metadata,
960
+ throwDefaultError({
961
+ output: output,
962
+ parsedBody: parsedBody,
963
+ exceptionCtor: __BaseException,
964
+ errorCode: errorCode,
982
965
  });
983
- throw __decorateServiceException(response, parsedBody);
966
+ _d.label = 15;
967
+ case 15: return [2];
984
968
  }
985
969
  });
986
970
  }); };
@@ -992,18 +976,18 @@ export var deserializeAws_restJson1DeleteIncidentRecordCommand = function (outpu
992
976
  if (output.statusCode !== 204 && output.statusCode >= 300) {
993
977
  return [2, deserializeAws_restJson1DeleteIncidentRecordCommandError(output, context)];
994
978
  }
995
- contents = {
979
+ contents = map({
996
980
  $metadata: deserializeMetadata(output),
997
- };
981
+ });
998
982
  return [4, collectBody(output.body, context)];
999
983
  case 1:
1000
984
  _a.sent();
1001
- return [2, Promise.resolve(contents)];
985
+ return [2, contents];
1002
986
  }
1003
987
  });
1004
988
  }); };
1005
989
  var deserializeAws_restJson1DeleteIncidentRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1006
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
990
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1007
991
  var _c;
1008
992
  return __generator(this, function (_d) {
1009
993
  switch (_d.label) {
@@ -1036,14 +1020,14 @@ var deserializeAws_restJson1DeleteIncidentRecordCommandError = function (output,
1036
1020
  case 9: throw _d.sent();
1037
1021
  case 10:
1038
1022
  parsedBody = parsedOutput.body;
1039
- $metadata = deserializeMetadata(output);
1040
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1041
- response = new __BaseException({
1042
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1043
- $fault: "client",
1044
- $metadata: $metadata,
1023
+ throwDefaultError({
1024
+ output: output,
1025
+ parsedBody: parsedBody,
1026
+ exceptionCtor: __BaseException,
1027
+ errorCode: errorCode,
1045
1028
  });
1046
- throw __decorateServiceException(response, parsedBody);
1029
+ _d.label = 11;
1030
+ case 11: return [2];
1047
1031
  }
1048
1032
  });
1049
1033
  }); };
@@ -1055,18 +1039,18 @@ export var deserializeAws_restJson1DeleteReplicationSetCommand = function (outpu
1055
1039
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1056
1040
  return [2, deserializeAws_restJson1DeleteReplicationSetCommandError(output, context)];
1057
1041
  }
1058
- contents = {
1042
+ contents = map({
1059
1043
  $metadata: deserializeMetadata(output),
1060
- };
1044
+ });
1061
1045
  return [4, collectBody(output.body, context)];
1062
1046
  case 1:
1063
1047
  _a.sent();
1064
- return [2, Promise.resolve(contents)];
1048
+ return [2, contents];
1065
1049
  }
1066
1050
  });
1067
1051
  }); };
1068
1052
  var deserializeAws_restJson1DeleteReplicationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1069
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1053
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1070
1054
  var _c;
1071
1055
  return __generator(this, function (_d) {
1072
1056
  switch (_d.label) {
@@ -1103,14 +1087,14 @@ var deserializeAws_restJson1DeleteReplicationSetCommandError = function (output,
1103
1087
  case 11: throw _d.sent();
1104
1088
  case 12:
1105
1089
  parsedBody = parsedOutput.body;
1106
- $metadata = deserializeMetadata(output);
1107
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1108
- response = new __BaseException({
1109
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1110
- $fault: "client",
1111
- $metadata: $metadata,
1090
+ throwDefaultError({
1091
+ output: output,
1092
+ parsedBody: parsedBody,
1093
+ exceptionCtor: __BaseException,
1094
+ errorCode: errorCode,
1112
1095
  });
1113
- throw __decorateServiceException(response, parsedBody);
1096
+ _d.label = 13;
1097
+ case 13: return [2];
1114
1098
  }
1115
1099
  });
1116
1100
  }); };
@@ -1122,18 +1106,18 @@ export var deserializeAws_restJson1DeleteResourcePolicyCommand = function (outpu
1122
1106
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1123
1107
  return [2, deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context)];
1124
1108
  }
1125
- contents = {
1109
+ contents = map({
1126
1110
  $metadata: deserializeMetadata(output),
1127
- };
1111
+ });
1128
1112
  return [4, collectBody(output.body, context)];
1129
1113
  case 1:
1130
1114
  _a.sent();
1131
- return [2, Promise.resolve(contents)];
1115
+ return [2, contents];
1132
1116
  }
1133
1117
  });
1134
1118
  }); };
1135
1119
  var deserializeAws_restJson1DeleteResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1136
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1120
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1137
1121
  var _c;
1138
1122
  return __generator(this, function (_d) {
1139
1123
  switch (_d.label) {
@@ -1170,14 +1154,14 @@ var deserializeAws_restJson1DeleteResourcePolicyCommandError = function (output,
1170
1154
  case 11: throw _d.sent();
1171
1155
  case 12:
1172
1156
  parsedBody = parsedOutput.body;
1173
- $metadata = deserializeMetadata(output);
1174
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1175
- response = new __BaseException({
1176
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1177
- $fault: "client",
1178
- $metadata: $metadata,
1157
+ throwDefaultError({
1158
+ output: output,
1159
+ parsedBody: parsedBody,
1160
+ exceptionCtor: __BaseException,
1161
+ errorCode: errorCode,
1179
1162
  });
1180
- throw __decorateServiceException(response, parsedBody);
1163
+ _d.label = 13;
1164
+ case 13: return [2];
1181
1165
  }
1182
1166
  });
1183
1167
  }); };
@@ -1189,18 +1173,18 @@ export var deserializeAws_restJson1DeleteResponsePlanCommand = function (output,
1189
1173
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1190
1174
  return [2, deserializeAws_restJson1DeleteResponsePlanCommandError(output, context)];
1191
1175
  }
1192
- contents = {
1176
+ contents = map({
1193
1177
  $metadata: deserializeMetadata(output),
1194
- };
1178
+ });
1195
1179
  return [4, collectBody(output.body, context)];
1196
1180
  case 1:
1197
1181
  _a.sent();
1198
- return [2, Promise.resolve(contents)];
1182
+ return [2, contents];
1199
1183
  }
1200
1184
  });
1201
1185
  }); };
1202
1186
  var deserializeAws_restJson1DeleteResponsePlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1203
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1187
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1204
1188
  var _c;
1205
1189
  return __generator(this, function (_d) {
1206
1190
  switch (_d.label) {
@@ -1233,14 +1217,14 @@ var deserializeAws_restJson1DeleteResponsePlanCommandError = function (output, c
1233
1217
  case 9: throw _d.sent();
1234
1218
  case 10:
1235
1219
  parsedBody = parsedOutput.body;
1236
- $metadata = deserializeMetadata(output);
1237
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1238
- response = new __BaseException({
1239
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1240
- $fault: "client",
1241
- $metadata: $metadata,
1220
+ throwDefaultError({
1221
+ output: output,
1222
+ parsedBody: parsedBody,
1223
+ exceptionCtor: __BaseException,
1224
+ errorCode: errorCode,
1242
1225
  });
1243
- throw __decorateServiceException(response, parsedBody);
1226
+ _d.label = 11;
1227
+ case 11: return [2];
1244
1228
  }
1245
1229
  });
1246
1230
  }); };
@@ -1252,18 +1236,18 @@ export var deserializeAws_restJson1DeleteTimelineEventCommand = function (output
1252
1236
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1253
1237
  return [2, deserializeAws_restJson1DeleteTimelineEventCommandError(output, context)];
1254
1238
  }
1255
- contents = {
1239
+ contents = map({
1256
1240
  $metadata: deserializeMetadata(output),
1257
- };
1241
+ });
1258
1242
  return [4, collectBody(output.body, context)];
1259
1243
  case 1:
1260
1244
  _a.sent();
1261
- return [2, Promise.resolve(contents)];
1245
+ return [2, contents];
1262
1246
  }
1263
1247
  });
1264
1248
  }); };
1265
1249
  var deserializeAws_restJson1DeleteTimelineEventCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1266
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1250
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1267
1251
  var _c;
1268
1252
  return __generator(this, function (_d) {
1269
1253
  switch (_d.label) {
@@ -1296,14 +1280,14 @@ var deserializeAws_restJson1DeleteTimelineEventCommandError = function (output,
1296
1280
  case 9: throw _d.sent();
1297
1281
  case 10:
1298
1282
  parsedBody = parsedOutput.body;
1299
- $metadata = deserializeMetadata(output);
1300
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1301
- response = new __BaseException({
1302
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1303
- $fault: "client",
1304
- $metadata: $metadata,
1283
+ throwDefaultError({
1284
+ output: output,
1285
+ parsedBody: parsedBody,
1286
+ exceptionCtor: __BaseException,
1287
+ errorCode: errorCode,
1305
1288
  });
1306
- throw __decorateServiceException(response, parsedBody);
1289
+ _d.label = 11;
1290
+ case 11: return [2];
1307
1291
  }
1308
1292
  });
1309
1293
  }); };
@@ -1315,24 +1299,23 @@ export var deserializeAws_restJson1GetIncidentRecordCommand = function (output,
1315
1299
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1316
1300
  return [2, deserializeAws_restJson1GetIncidentRecordCommandError(output, context)];
1317
1301
  }
1318
- contents = {
1302
+ contents = map({
1319
1303
  $metadata: deserializeMetadata(output),
1320
- incidentRecord: undefined,
1321
- };
1304
+ });
1322
1305
  _a = __expectNonNull;
1323
1306
  _b = __expectObject;
1324
1307
  return [4, parseBody(output.body, context)];
1325
1308
  case 1:
1326
1309
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1327
- if (data.incidentRecord !== undefined && data.incidentRecord !== null) {
1310
+ if (data.incidentRecord != null) {
1328
1311
  contents.incidentRecord = deserializeAws_restJson1IncidentRecord(data.incidentRecord, context);
1329
1312
  }
1330
- return [2, Promise.resolve(contents)];
1313
+ return [2, contents];
1331
1314
  }
1332
1315
  });
1333
1316
  }); };
1334
1317
  var deserializeAws_restJson1GetIncidentRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1335
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1318
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1336
1319
  var _c;
1337
1320
  return __generator(this, function (_d) {
1338
1321
  switch (_d.label) {
@@ -1369,14 +1352,14 @@ var deserializeAws_restJson1GetIncidentRecordCommandError = function (output, co
1369
1352
  case 11: throw _d.sent();
1370
1353
  case 12:
1371
1354
  parsedBody = parsedOutput.body;
1372
- $metadata = deserializeMetadata(output);
1373
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1374
- response = new __BaseException({
1375
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1376
- $fault: "client",
1377
- $metadata: $metadata,
1355
+ throwDefaultError({
1356
+ output: output,
1357
+ parsedBody: parsedBody,
1358
+ exceptionCtor: __BaseException,
1359
+ errorCode: errorCode,
1378
1360
  });
1379
- throw __decorateServiceException(response, parsedBody);
1361
+ _d.label = 13;
1362
+ case 13: return [2];
1380
1363
  }
1381
1364
  });
1382
1365
  }); };
@@ -1388,24 +1371,23 @@ export var deserializeAws_restJson1GetReplicationSetCommand = function (output,
1388
1371
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1389
1372
  return [2, deserializeAws_restJson1GetReplicationSetCommandError(output, context)];
1390
1373
  }
1391
- contents = {
1374
+ contents = map({
1392
1375
  $metadata: deserializeMetadata(output),
1393
- replicationSet: undefined,
1394
- };
1376
+ });
1395
1377
  _a = __expectNonNull;
1396
1378
  _b = __expectObject;
1397
1379
  return [4, parseBody(output.body, context)];
1398
1380
  case 1:
1399
1381
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1400
- if (data.replicationSet !== undefined && data.replicationSet !== null) {
1382
+ if (data.replicationSet != null) {
1401
1383
  contents.replicationSet = deserializeAws_restJson1ReplicationSet(data.replicationSet, context);
1402
1384
  }
1403
- return [2, Promise.resolve(contents)];
1385
+ return [2, contents];
1404
1386
  }
1405
1387
  });
1406
1388
  }); };
1407
1389
  var deserializeAws_restJson1GetReplicationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1408
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1390
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1409
1391
  var _c;
1410
1392
  return __generator(this, function (_d) {
1411
1393
  switch (_d.label) {
@@ -1442,14 +1424,14 @@ var deserializeAws_restJson1GetReplicationSetCommandError = function (output, co
1442
1424
  case 11: throw _d.sent();
1443
1425
  case 12:
1444
1426
  parsedBody = parsedOutput.body;
1445
- $metadata = deserializeMetadata(output);
1446
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1447
- response = new __BaseException({
1448
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1449
- $fault: "client",
1450
- $metadata: $metadata,
1427
+ throwDefaultError({
1428
+ output: output,
1429
+ parsedBody: parsedBody,
1430
+ exceptionCtor: __BaseException,
1431
+ errorCode: errorCode,
1451
1432
  });
1452
- throw __decorateServiceException(response, parsedBody);
1433
+ _d.label = 13;
1434
+ case 13: return [2];
1453
1435
  }
1454
1436
  });
1455
1437
  }); };
@@ -1461,28 +1443,26 @@ export var deserializeAws_restJson1GetResourcePoliciesCommand = function (output
1461
1443
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1462
1444
  return [2, deserializeAws_restJson1GetResourcePoliciesCommandError(output, context)];
1463
1445
  }
1464
- contents = {
1446
+ contents = map({
1465
1447
  $metadata: deserializeMetadata(output),
1466
- nextToken: undefined,
1467
- resourcePolicies: undefined,
1468
- };
1448
+ });
1469
1449
  _a = __expectNonNull;
1470
1450
  _b = __expectObject;
1471
1451
  return [4, parseBody(output.body, context)];
1472
1452
  case 1:
1473
1453
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1474
- if (data.nextToken !== undefined && data.nextToken !== null) {
1454
+ if (data.nextToken != null) {
1475
1455
  contents.nextToken = __expectString(data.nextToken);
1476
1456
  }
1477
- if (data.resourcePolicies !== undefined && data.resourcePolicies !== null) {
1457
+ if (data.resourcePolicies != null) {
1478
1458
  contents.resourcePolicies = deserializeAws_restJson1ResourcePolicyList(data.resourcePolicies, context);
1479
1459
  }
1480
- return [2, Promise.resolve(contents)];
1460
+ return [2, contents];
1481
1461
  }
1482
1462
  });
1483
1463
  }); };
1484
1464
  var deserializeAws_restJson1GetResourcePoliciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1485
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1465
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1486
1466
  var _c;
1487
1467
  return __generator(this, function (_d) {
1488
1468
  switch (_d.label) {
@@ -1519,14 +1499,14 @@ var deserializeAws_restJson1GetResourcePoliciesCommandError = function (output,
1519
1499
  case 11: throw _d.sent();
1520
1500
  case 12:
1521
1501
  parsedBody = parsedOutput.body;
1522
- $metadata = deserializeMetadata(output);
1523
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1524
- response = new __BaseException({
1525
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1526
- $fault: "client",
1527
- $metadata: $metadata,
1502
+ throwDefaultError({
1503
+ output: output,
1504
+ parsedBody: parsedBody,
1505
+ exceptionCtor: __BaseException,
1506
+ errorCode: errorCode,
1528
1507
  });
1529
- throw __decorateServiceException(response, parsedBody);
1508
+ _d.label = 13;
1509
+ case 13: return [2];
1530
1510
  }
1531
1511
  });
1532
1512
  }); };
@@ -1538,48 +1518,41 @@ export var deserializeAws_restJson1GetResponsePlanCommand = function (output, co
1538
1518
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1539
1519
  return [2, deserializeAws_restJson1GetResponsePlanCommandError(output, context)];
1540
1520
  }
1541
- contents = {
1521
+ contents = map({
1542
1522
  $metadata: deserializeMetadata(output),
1543
- actions: undefined,
1544
- arn: undefined,
1545
- chatChannel: undefined,
1546
- displayName: undefined,
1547
- engagements: undefined,
1548
- incidentTemplate: undefined,
1549
- name: undefined,
1550
- };
1523
+ });
1551
1524
  _a = __expectNonNull;
1552
1525
  _b = __expectObject;
1553
1526
  return [4, parseBody(output.body, context)];
1554
1527
  case 1:
1555
1528
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1556
- if (data.actions !== undefined && data.actions !== null) {
1529
+ if (data.actions != null) {
1557
1530
  contents.actions = deserializeAws_restJson1ActionsList(data.actions, context);
1558
1531
  }
1559
- if (data.arn !== undefined && data.arn !== null) {
1532
+ if (data.arn != null) {
1560
1533
  contents.arn = __expectString(data.arn);
1561
1534
  }
1562
- if (data.chatChannel !== undefined && data.chatChannel !== null) {
1535
+ if (data.chatChannel != null) {
1563
1536
  contents.chatChannel = deserializeAws_restJson1ChatChannel(__expectUnion(data.chatChannel), context);
1564
1537
  }
1565
- if (data.displayName !== undefined && data.displayName !== null) {
1538
+ if (data.displayName != null) {
1566
1539
  contents.displayName = __expectString(data.displayName);
1567
1540
  }
1568
- if (data.engagements !== undefined && data.engagements !== null) {
1541
+ if (data.engagements != null) {
1569
1542
  contents.engagements = deserializeAws_restJson1EngagementSet(data.engagements, context);
1570
1543
  }
1571
- if (data.incidentTemplate !== undefined && data.incidentTemplate !== null) {
1544
+ if (data.incidentTemplate != null) {
1572
1545
  contents.incidentTemplate = deserializeAws_restJson1IncidentTemplate(data.incidentTemplate, context);
1573
1546
  }
1574
- if (data.name !== undefined && data.name !== null) {
1547
+ if (data.name != null) {
1575
1548
  contents.name = __expectString(data.name);
1576
1549
  }
1577
- return [2, Promise.resolve(contents)];
1550
+ return [2, contents];
1578
1551
  }
1579
1552
  });
1580
1553
  }); };
1581
1554
  var deserializeAws_restJson1GetResponsePlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1582
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1555
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1583
1556
  var _c;
1584
1557
  return __generator(this, function (_d) {
1585
1558
  switch (_d.label) {
@@ -1616,14 +1589,14 @@ var deserializeAws_restJson1GetResponsePlanCommandError = function (output, cont
1616
1589
  case 11: throw _d.sent();
1617
1590
  case 12:
1618
1591
  parsedBody = parsedOutput.body;
1619
- $metadata = deserializeMetadata(output);
1620
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1621
- response = new __BaseException({
1622
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1623
- $fault: "client",
1624
- $metadata: $metadata,
1592
+ throwDefaultError({
1593
+ output: output,
1594
+ parsedBody: parsedBody,
1595
+ exceptionCtor: __BaseException,
1596
+ errorCode: errorCode,
1625
1597
  });
1626
- throw __decorateServiceException(response, parsedBody);
1598
+ _d.label = 13;
1599
+ case 13: return [2];
1627
1600
  }
1628
1601
  });
1629
1602
  }); };
@@ -1635,24 +1608,23 @@ export var deserializeAws_restJson1GetTimelineEventCommand = function (output, c
1635
1608
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1636
1609
  return [2, deserializeAws_restJson1GetTimelineEventCommandError(output, context)];
1637
1610
  }
1638
- contents = {
1611
+ contents = map({
1639
1612
  $metadata: deserializeMetadata(output),
1640
- event: undefined,
1641
- };
1613
+ });
1642
1614
  _a = __expectNonNull;
1643
1615
  _b = __expectObject;
1644
1616
  return [4, parseBody(output.body, context)];
1645
1617
  case 1:
1646
1618
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1647
- if (data.event !== undefined && data.event !== null) {
1619
+ if (data.event != null) {
1648
1620
  contents.event = deserializeAws_restJson1TimelineEvent(data.event, context);
1649
1621
  }
1650
- return [2, Promise.resolve(contents)];
1622
+ return [2, contents];
1651
1623
  }
1652
1624
  });
1653
1625
  }); };
1654
1626
  var deserializeAws_restJson1GetTimelineEventCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1655
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1627
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1656
1628
  var _c;
1657
1629
  return __generator(this, function (_d) {
1658
1630
  switch (_d.label) {
@@ -1689,14 +1661,14 @@ var deserializeAws_restJson1GetTimelineEventCommandError = function (output, con
1689
1661
  case 11: throw _d.sent();
1690
1662
  case 12:
1691
1663
  parsedBody = parsedOutput.body;
1692
- $metadata = deserializeMetadata(output);
1693
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1694
- response = new __BaseException({
1695
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1696
- $fault: "client",
1697
- $metadata: $metadata,
1664
+ throwDefaultError({
1665
+ output: output,
1666
+ parsedBody: parsedBody,
1667
+ exceptionCtor: __BaseException,
1668
+ errorCode: errorCode,
1698
1669
  });
1699
- throw __decorateServiceException(response, parsedBody);
1670
+ _d.label = 13;
1671
+ case 13: return [2];
1700
1672
  }
1701
1673
  });
1702
1674
  }); };
@@ -1708,28 +1680,26 @@ export var deserializeAws_restJson1ListIncidentRecordsCommand = function (output
1708
1680
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1709
1681
  return [2, deserializeAws_restJson1ListIncidentRecordsCommandError(output, context)];
1710
1682
  }
1711
- contents = {
1683
+ contents = map({
1712
1684
  $metadata: deserializeMetadata(output),
1713
- incidentRecordSummaries: undefined,
1714
- nextToken: undefined,
1715
- };
1685
+ });
1716
1686
  _a = __expectNonNull;
1717
1687
  _b = __expectObject;
1718
1688
  return [4, parseBody(output.body, context)];
1719
1689
  case 1:
1720
1690
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1721
- if (data.incidentRecordSummaries !== undefined && data.incidentRecordSummaries !== null) {
1691
+ if (data.incidentRecordSummaries != null) {
1722
1692
  contents.incidentRecordSummaries = deserializeAws_restJson1IncidentRecordSummaryList(data.incidentRecordSummaries, context);
1723
1693
  }
1724
- if (data.nextToken !== undefined && data.nextToken !== null) {
1694
+ if (data.nextToken != null) {
1725
1695
  contents.nextToken = __expectString(data.nextToken);
1726
1696
  }
1727
- return [2, Promise.resolve(contents)];
1697
+ return [2, contents];
1728
1698
  }
1729
1699
  });
1730
1700
  }); };
1731
1701
  var deserializeAws_restJson1ListIncidentRecordsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1732
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1702
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1733
1703
  var _c;
1734
1704
  return __generator(this, function (_d) {
1735
1705
  switch (_d.label) {
@@ -1762,14 +1732,14 @@ var deserializeAws_restJson1ListIncidentRecordsCommandError = function (output,
1762
1732
  case 9: throw _d.sent();
1763
1733
  case 10:
1764
1734
  parsedBody = parsedOutput.body;
1765
- $metadata = deserializeMetadata(output);
1766
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1767
- response = new __BaseException({
1768
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1769
- $fault: "client",
1770
- $metadata: $metadata,
1735
+ throwDefaultError({
1736
+ output: output,
1737
+ parsedBody: parsedBody,
1738
+ exceptionCtor: __BaseException,
1739
+ errorCode: errorCode,
1771
1740
  });
1772
- throw __decorateServiceException(response, parsedBody);
1741
+ _d.label = 11;
1742
+ case 11: return [2];
1773
1743
  }
1774
1744
  });
1775
1745
  }); };
@@ -1781,28 +1751,26 @@ export var deserializeAws_restJson1ListRelatedItemsCommand = function (output, c
1781
1751
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1782
1752
  return [2, deserializeAws_restJson1ListRelatedItemsCommandError(output, context)];
1783
1753
  }
1784
- contents = {
1754
+ contents = map({
1785
1755
  $metadata: deserializeMetadata(output),
1786
- nextToken: undefined,
1787
- relatedItems: undefined,
1788
- };
1756
+ });
1789
1757
  _a = __expectNonNull;
1790
1758
  _b = __expectObject;
1791
1759
  return [4, parseBody(output.body, context)];
1792
1760
  case 1:
1793
1761
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1794
- if (data.nextToken !== undefined && data.nextToken !== null) {
1762
+ if (data.nextToken != null) {
1795
1763
  contents.nextToken = __expectString(data.nextToken);
1796
1764
  }
1797
- if (data.relatedItems !== undefined && data.relatedItems !== null) {
1765
+ if (data.relatedItems != null) {
1798
1766
  contents.relatedItems = deserializeAws_restJson1RelatedItemList(data.relatedItems, context);
1799
1767
  }
1800
- return [2, Promise.resolve(contents)];
1768
+ return [2, contents];
1801
1769
  }
1802
1770
  });
1803
1771
  }); };
1804
1772
  var deserializeAws_restJson1ListRelatedItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1805
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1773
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1806
1774
  var _c;
1807
1775
  return __generator(this, function (_d) {
1808
1776
  switch (_d.label) {
@@ -1835,14 +1803,14 @@ var deserializeAws_restJson1ListRelatedItemsCommandError = function (output, con
1835
1803
  case 9: throw _d.sent();
1836
1804
  case 10:
1837
1805
  parsedBody = parsedOutput.body;
1838
- $metadata = deserializeMetadata(output);
1839
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1840
- response = new __BaseException({
1841
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1842
- $fault: "client",
1843
- $metadata: $metadata,
1806
+ throwDefaultError({
1807
+ output: output,
1808
+ parsedBody: parsedBody,
1809
+ exceptionCtor: __BaseException,
1810
+ errorCode: errorCode,
1844
1811
  });
1845
- throw __decorateServiceException(response, parsedBody);
1812
+ _d.label = 11;
1813
+ case 11: return [2];
1846
1814
  }
1847
1815
  });
1848
1816
  }); };
@@ -1854,28 +1822,26 @@ export var deserializeAws_restJson1ListReplicationSetsCommand = function (output
1854
1822
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1855
1823
  return [2, deserializeAws_restJson1ListReplicationSetsCommandError(output, context)];
1856
1824
  }
1857
- contents = {
1825
+ contents = map({
1858
1826
  $metadata: deserializeMetadata(output),
1859
- nextToken: undefined,
1860
- replicationSetArns: undefined,
1861
- };
1827
+ });
1862
1828
  _a = __expectNonNull;
1863
1829
  _b = __expectObject;
1864
1830
  return [4, parseBody(output.body, context)];
1865
1831
  case 1:
1866
1832
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1867
- if (data.nextToken !== undefined && data.nextToken !== null) {
1833
+ if (data.nextToken != null) {
1868
1834
  contents.nextToken = __expectString(data.nextToken);
1869
1835
  }
1870
- if (data.replicationSetArns !== undefined && data.replicationSetArns !== null) {
1836
+ if (data.replicationSetArns != null) {
1871
1837
  contents.replicationSetArns = deserializeAws_restJson1ReplicationSetArnList(data.replicationSetArns, context);
1872
1838
  }
1873
- return [2, Promise.resolve(contents)];
1839
+ return [2, contents];
1874
1840
  }
1875
1841
  });
1876
1842
  }); };
1877
1843
  var deserializeAws_restJson1ListReplicationSetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1878
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1844
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1879
1845
  var _c;
1880
1846
  return __generator(this, function (_d) {
1881
1847
  switch (_d.label) {
@@ -1908,14 +1874,14 @@ var deserializeAws_restJson1ListReplicationSetsCommandError = function (output,
1908
1874
  case 9: throw _d.sent();
1909
1875
  case 10:
1910
1876
  parsedBody = parsedOutput.body;
1911
- $metadata = deserializeMetadata(output);
1912
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1913
- response = new __BaseException({
1914
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1915
- $fault: "client",
1916
- $metadata: $metadata,
1877
+ throwDefaultError({
1878
+ output: output,
1879
+ parsedBody: parsedBody,
1880
+ exceptionCtor: __BaseException,
1881
+ errorCode: errorCode,
1917
1882
  });
1918
- throw __decorateServiceException(response, parsedBody);
1883
+ _d.label = 11;
1884
+ case 11: return [2];
1919
1885
  }
1920
1886
  });
1921
1887
  }); };
@@ -1927,28 +1893,26 @@ export var deserializeAws_restJson1ListResponsePlansCommand = function (output,
1927
1893
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1928
1894
  return [2, deserializeAws_restJson1ListResponsePlansCommandError(output, context)];
1929
1895
  }
1930
- contents = {
1896
+ contents = map({
1931
1897
  $metadata: deserializeMetadata(output),
1932
- nextToken: undefined,
1933
- responsePlanSummaries: undefined,
1934
- };
1898
+ });
1935
1899
  _a = __expectNonNull;
1936
1900
  _b = __expectObject;
1937
1901
  return [4, parseBody(output.body, context)];
1938
1902
  case 1:
1939
1903
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1940
- if (data.nextToken !== undefined && data.nextToken !== null) {
1904
+ if (data.nextToken != null) {
1941
1905
  contents.nextToken = __expectString(data.nextToken);
1942
1906
  }
1943
- if (data.responsePlanSummaries !== undefined && data.responsePlanSummaries !== null) {
1907
+ if (data.responsePlanSummaries != null) {
1944
1908
  contents.responsePlanSummaries = deserializeAws_restJson1ResponsePlanSummaryList(data.responsePlanSummaries, context);
1945
1909
  }
1946
- return [2, Promise.resolve(contents)];
1910
+ return [2, contents];
1947
1911
  }
1948
1912
  });
1949
1913
  }); };
1950
1914
  var deserializeAws_restJson1ListResponsePlansCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1951
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1915
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1952
1916
  var _c;
1953
1917
  return __generator(this, function (_d) {
1954
1918
  switch (_d.label) {
@@ -1981,14 +1945,14 @@ var deserializeAws_restJson1ListResponsePlansCommandError = function (output, co
1981
1945
  case 9: throw _d.sent();
1982
1946
  case 10:
1983
1947
  parsedBody = parsedOutput.body;
1984
- $metadata = deserializeMetadata(output);
1985
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1986
- response = new __BaseException({
1987
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1988
- $fault: "client",
1989
- $metadata: $metadata,
1948
+ throwDefaultError({
1949
+ output: output,
1950
+ parsedBody: parsedBody,
1951
+ exceptionCtor: __BaseException,
1952
+ errorCode: errorCode,
1990
1953
  });
1991
- throw __decorateServiceException(response, parsedBody);
1954
+ _d.label = 11;
1955
+ case 11: return [2];
1992
1956
  }
1993
1957
  });
1994
1958
  }); };
@@ -2000,24 +1964,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2000
1964
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2001
1965
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2002
1966
  }
2003
- contents = {
1967
+ contents = map({
2004
1968
  $metadata: deserializeMetadata(output),
2005
- tags: undefined,
2006
- };
1969
+ });
2007
1970
  _a = __expectNonNull;
2008
1971
  _b = __expectObject;
2009
1972
  return [4, parseBody(output.body, context)];
2010
1973
  case 1:
2011
1974
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2012
- if (data.tags !== undefined && data.tags !== null) {
1975
+ if (data.tags != null) {
2013
1976
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
2014
1977
  }
2015
- return [2, Promise.resolve(contents)];
1978
+ return [2, contents];
2016
1979
  }
2017
1980
  });
2018
1981
  }); };
2019
1982
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2020
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1983
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2021
1984
  var _c;
2022
1985
  return __generator(this, function (_d) {
2023
1986
  switch (_d.label) {
@@ -2054,14 +2017,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2054
2017
  case 11: throw _d.sent();
2055
2018
  case 12:
2056
2019
  parsedBody = parsedOutput.body;
2057
- $metadata = deserializeMetadata(output);
2058
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2059
- response = new __BaseException({
2060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2061
- $fault: "client",
2062
- $metadata: $metadata,
2020
+ throwDefaultError({
2021
+ output: output,
2022
+ parsedBody: parsedBody,
2023
+ exceptionCtor: __BaseException,
2024
+ errorCode: errorCode,
2063
2025
  });
2064
- throw __decorateServiceException(response, parsedBody);
2026
+ _d.label = 13;
2027
+ case 13: return [2];
2065
2028
  }
2066
2029
  });
2067
2030
  }); };
@@ -2073,28 +2036,26 @@ export var deserializeAws_restJson1ListTimelineEventsCommand = function (output,
2073
2036
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2074
2037
  return [2, deserializeAws_restJson1ListTimelineEventsCommandError(output, context)];
2075
2038
  }
2076
- contents = {
2039
+ contents = map({
2077
2040
  $metadata: deserializeMetadata(output),
2078
- eventSummaries: undefined,
2079
- nextToken: undefined,
2080
- };
2041
+ });
2081
2042
  _a = __expectNonNull;
2082
2043
  _b = __expectObject;
2083
2044
  return [4, parseBody(output.body, context)];
2084
2045
  case 1:
2085
2046
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2086
- if (data.eventSummaries !== undefined && data.eventSummaries !== null) {
2047
+ if (data.eventSummaries != null) {
2087
2048
  contents.eventSummaries = deserializeAws_restJson1EventSummaryList(data.eventSummaries, context);
2088
2049
  }
2089
- if (data.nextToken !== undefined && data.nextToken !== null) {
2050
+ if (data.nextToken != null) {
2090
2051
  contents.nextToken = __expectString(data.nextToken);
2091
2052
  }
2092
- return [2, Promise.resolve(contents)];
2053
+ return [2, contents];
2093
2054
  }
2094
2055
  });
2095
2056
  }); };
2096
2057
  var deserializeAws_restJson1ListTimelineEventsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2097
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2058
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2098
2059
  var _c;
2099
2060
  return __generator(this, function (_d) {
2100
2061
  switch (_d.label) {
@@ -2127,14 +2088,14 @@ var deserializeAws_restJson1ListTimelineEventsCommandError = function (output, c
2127
2088
  case 9: throw _d.sent();
2128
2089
  case 10:
2129
2090
  parsedBody = parsedOutput.body;
2130
- $metadata = deserializeMetadata(output);
2131
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2132
- response = new __BaseException({
2133
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2134
- $fault: "client",
2135
- $metadata: $metadata,
2091
+ throwDefaultError({
2092
+ output: output,
2093
+ parsedBody: parsedBody,
2094
+ exceptionCtor: __BaseException,
2095
+ errorCode: errorCode,
2136
2096
  });
2137
- throw __decorateServiceException(response, parsedBody);
2097
+ _d.label = 11;
2098
+ case 11: return [2];
2138
2099
  }
2139
2100
  });
2140
2101
  }); };
@@ -2146,24 +2107,23 @@ export var deserializeAws_restJson1PutResourcePolicyCommand = function (output,
2146
2107
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2147
2108
  return [2, deserializeAws_restJson1PutResourcePolicyCommandError(output, context)];
2148
2109
  }
2149
- contents = {
2110
+ contents = map({
2150
2111
  $metadata: deserializeMetadata(output),
2151
- policyId: undefined,
2152
- };
2112
+ });
2153
2113
  _a = __expectNonNull;
2154
2114
  _b = __expectObject;
2155
2115
  return [4, parseBody(output.body, context)];
2156
2116
  case 1:
2157
2117
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2158
- if (data.policyId !== undefined && data.policyId !== null) {
2118
+ if (data.policyId != null) {
2159
2119
  contents.policyId = __expectString(data.policyId);
2160
2120
  }
2161
- return [2, Promise.resolve(contents)];
2121
+ return [2, contents];
2162
2122
  }
2163
2123
  });
2164
2124
  }); };
2165
2125
  var deserializeAws_restJson1PutResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2126
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2167
2127
  var _c;
2168
2128
  return __generator(this, function (_d) {
2169
2129
  switch (_d.label) {
@@ -2200,14 +2160,14 @@ var deserializeAws_restJson1PutResourcePolicyCommandError = function (output, co
2200
2160
  case 11: throw _d.sent();
2201
2161
  case 12:
2202
2162
  parsedBody = parsedOutput.body;
2203
- $metadata = deserializeMetadata(output);
2204
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2205
- response = new __BaseException({
2206
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2207
- $fault: "client",
2208
- $metadata: $metadata,
2163
+ throwDefaultError({
2164
+ output: output,
2165
+ parsedBody: parsedBody,
2166
+ exceptionCtor: __BaseException,
2167
+ errorCode: errorCode,
2209
2168
  });
2210
- throw __decorateServiceException(response, parsedBody);
2169
+ _d.label = 13;
2170
+ case 13: return [2];
2211
2171
  }
2212
2172
  });
2213
2173
  }); };
@@ -2219,24 +2179,23 @@ export var deserializeAws_restJson1StartIncidentCommand = function (output, cont
2219
2179
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2220
2180
  return [2, deserializeAws_restJson1StartIncidentCommandError(output, context)];
2221
2181
  }
2222
- contents = {
2182
+ contents = map({
2223
2183
  $metadata: deserializeMetadata(output),
2224
- incidentRecordArn: undefined,
2225
- };
2184
+ });
2226
2185
  _a = __expectNonNull;
2227
2186
  _b = __expectObject;
2228
2187
  return [4, parseBody(output.body, context)];
2229
2188
  case 1:
2230
2189
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2231
- if (data.incidentRecordArn !== undefined && data.incidentRecordArn !== null) {
2190
+ if (data.incidentRecordArn != null) {
2232
2191
  contents.incidentRecordArn = __expectString(data.incidentRecordArn);
2233
2192
  }
2234
- return [2, Promise.resolve(contents)];
2193
+ return [2, contents];
2235
2194
  }
2236
2195
  });
2237
2196
  }); };
2238
2197
  var deserializeAws_restJson1StartIncidentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2239
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2198
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2240
2199
  var _c;
2241
2200
  return __generator(this, function (_d) {
2242
2201
  switch (_d.label) {
@@ -2277,14 +2236,14 @@ var deserializeAws_restJson1StartIncidentCommandError = function (output, contex
2277
2236
  case 13: throw _d.sent();
2278
2237
  case 14:
2279
2238
  parsedBody = parsedOutput.body;
2280
- $metadata = deserializeMetadata(output);
2281
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2282
- response = new __BaseException({
2283
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2284
- $fault: "client",
2285
- $metadata: $metadata,
2239
+ throwDefaultError({
2240
+ output: output,
2241
+ parsedBody: parsedBody,
2242
+ exceptionCtor: __BaseException,
2243
+ errorCode: errorCode,
2286
2244
  });
2287
- throw __decorateServiceException(response, parsedBody);
2245
+ _d.label = 15;
2246
+ case 15: return [2];
2288
2247
  }
2289
2248
  });
2290
2249
  }); };
@@ -2296,18 +2255,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2296
2255
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2297
2256
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2298
2257
  }
2299
- contents = {
2258
+ contents = map({
2300
2259
  $metadata: deserializeMetadata(output),
2301
- };
2260
+ });
2302
2261
  return [4, collectBody(output.body, context)];
2303
2262
  case 1:
2304
2263
  _a.sent();
2305
- return [2, Promise.resolve(contents)];
2264
+ return [2, contents];
2306
2265
  }
2307
2266
  });
2308
2267
  }); };
2309
2268
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2310
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2269
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2311
2270
  var _c;
2312
2271
  return __generator(this, function (_d) {
2313
2272
  switch (_d.label) {
@@ -2352,14 +2311,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2352
2311
  case 15: throw _d.sent();
2353
2312
  case 16:
2354
2313
  parsedBody = parsedOutput.body;
2355
- $metadata = deserializeMetadata(output);
2356
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2357
- response = new __BaseException({
2358
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2359
- $fault: "client",
2360
- $metadata: $metadata,
2314
+ throwDefaultError({
2315
+ output: output,
2316
+ parsedBody: parsedBody,
2317
+ exceptionCtor: __BaseException,
2318
+ errorCode: errorCode,
2361
2319
  });
2362
- throw __decorateServiceException(response, parsedBody);
2320
+ _d.label = 17;
2321
+ case 17: return [2];
2363
2322
  }
2364
2323
  });
2365
2324
  }); };
@@ -2371,18 +2330,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2371
2330
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2372
2331
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2373
2332
  }
2374
- contents = {
2333
+ contents = map({
2375
2334
  $metadata: deserializeMetadata(output),
2376
- };
2335
+ });
2377
2336
  return [4, collectBody(output.body, context)];
2378
2337
  case 1:
2379
2338
  _a.sent();
2380
- return [2, Promise.resolve(contents)];
2339
+ return [2, contents];
2381
2340
  }
2382
2341
  });
2383
2342
  }); };
2384
2343
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2385
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2344
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2386
2345
  var _c;
2387
2346
  return __generator(this, function (_d) {
2388
2347
  switch (_d.label) {
@@ -2423,14 +2382,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2423
2382
  case 13: throw _d.sent();
2424
2383
  case 14:
2425
2384
  parsedBody = parsedOutput.body;
2426
- $metadata = deserializeMetadata(output);
2427
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2428
- response = new __BaseException({
2429
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2430
- $fault: "client",
2431
- $metadata: $metadata,
2385
+ throwDefaultError({
2386
+ output: output,
2387
+ parsedBody: parsedBody,
2388
+ exceptionCtor: __BaseException,
2389
+ errorCode: errorCode,
2432
2390
  });
2433
- throw __decorateServiceException(response, parsedBody);
2391
+ _d.label = 15;
2392
+ case 15: return [2];
2434
2393
  }
2435
2394
  });
2436
2395
  }); };
@@ -2442,18 +2401,18 @@ export var deserializeAws_restJson1UpdateDeletionProtectionCommand = function (o
2442
2401
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2443
2402
  return [2, deserializeAws_restJson1UpdateDeletionProtectionCommandError(output, context)];
2444
2403
  }
2445
- contents = {
2404
+ contents = map({
2446
2405
  $metadata: deserializeMetadata(output),
2447
- };
2406
+ });
2448
2407
  return [4, collectBody(output.body, context)];
2449
2408
  case 1:
2450
2409
  _a.sent();
2451
- return [2, Promise.resolve(contents)];
2410
+ return [2, contents];
2452
2411
  }
2453
2412
  });
2454
2413
  }); };
2455
2414
  var deserializeAws_restJson1UpdateDeletionProtectionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2456
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2415
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2457
2416
  var _c;
2458
2417
  return __generator(this, function (_d) {
2459
2418
  switch (_d.label) {
@@ -2490,14 +2449,14 @@ var deserializeAws_restJson1UpdateDeletionProtectionCommandError = function (out
2490
2449
  case 11: throw _d.sent();
2491
2450
  case 12:
2492
2451
  parsedBody = parsedOutput.body;
2493
- $metadata = deserializeMetadata(output);
2494
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2495
- response = new __BaseException({
2496
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2497
- $fault: "client",
2498
- $metadata: $metadata,
2452
+ throwDefaultError({
2453
+ output: output,
2454
+ parsedBody: parsedBody,
2455
+ exceptionCtor: __BaseException,
2456
+ errorCode: errorCode,
2499
2457
  });
2500
- throw __decorateServiceException(response, parsedBody);
2458
+ _d.label = 13;
2459
+ case 13: return [2];
2501
2460
  }
2502
2461
  });
2503
2462
  }); };
@@ -2509,18 +2468,18 @@ export var deserializeAws_restJson1UpdateIncidentRecordCommand = function (outpu
2509
2468
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2510
2469
  return [2, deserializeAws_restJson1UpdateIncidentRecordCommandError(output, context)];
2511
2470
  }
2512
- contents = {
2471
+ contents = map({
2513
2472
  $metadata: deserializeMetadata(output),
2514
- };
2473
+ });
2515
2474
  return [4, collectBody(output.body, context)];
2516
2475
  case 1:
2517
2476
  _a.sent();
2518
- return [2, Promise.resolve(contents)];
2477
+ return [2, contents];
2519
2478
  }
2520
2479
  });
2521
2480
  }); };
2522
2481
  var deserializeAws_restJson1UpdateIncidentRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2523
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2482
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2524
2483
  var _c;
2525
2484
  return __generator(this, function (_d) {
2526
2485
  switch (_d.label) {
@@ -2561,14 +2520,14 @@ var deserializeAws_restJson1UpdateIncidentRecordCommandError = function (output,
2561
2520
  case 13: throw _d.sent();
2562
2521
  case 14:
2563
2522
  parsedBody = parsedOutput.body;
2564
- $metadata = deserializeMetadata(output);
2565
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2566
- response = new __BaseException({
2567
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2568
- $fault: "client",
2569
- $metadata: $metadata,
2523
+ throwDefaultError({
2524
+ output: output,
2525
+ parsedBody: parsedBody,
2526
+ exceptionCtor: __BaseException,
2527
+ errorCode: errorCode,
2570
2528
  });
2571
- throw __decorateServiceException(response, parsedBody);
2529
+ _d.label = 15;
2530
+ case 15: return [2];
2572
2531
  }
2573
2532
  });
2574
2533
  }); };
@@ -2580,18 +2539,18 @@ export var deserializeAws_restJson1UpdateRelatedItemsCommand = function (output,
2580
2539
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2581
2540
  return [2, deserializeAws_restJson1UpdateRelatedItemsCommandError(output, context)];
2582
2541
  }
2583
- contents = {
2542
+ contents = map({
2584
2543
  $metadata: deserializeMetadata(output),
2585
- };
2544
+ });
2586
2545
  return [4, collectBody(output.body, context)];
2587
2546
  case 1:
2588
2547
  _a.sent();
2589
- return [2, Promise.resolve(contents)];
2548
+ return [2, contents];
2590
2549
  }
2591
2550
  });
2592
2551
  }); };
2593
2552
  var deserializeAws_restJson1UpdateRelatedItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2594
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2553
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2595
2554
  var _c;
2596
2555
  return __generator(this, function (_d) {
2597
2556
  switch (_d.label) {
@@ -2632,14 +2591,14 @@ var deserializeAws_restJson1UpdateRelatedItemsCommandError = function (output, c
2632
2591
  case 13: throw _d.sent();
2633
2592
  case 14:
2634
2593
  parsedBody = parsedOutput.body;
2635
- $metadata = deserializeMetadata(output);
2636
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2637
- response = new __BaseException({
2638
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2639
- $fault: "client",
2640
- $metadata: $metadata,
2594
+ throwDefaultError({
2595
+ output: output,
2596
+ parsedBody: parsedBody,
2597
+ exceptionCtor: __BaseException,
2598
+ errorCode: errorCode,
2641
2599
  });
2642
- throw __decorateServiceException(response, parsedBody);
2600
+ _d.label = 15;
2601
+ case 15: return [2];
2643
2602
  }
2644
2603
  });
2645
2604
  }); };
@@ -2651,18 +2610,18 @@ export var deserializeAws_restJson1UpdateReplicationSetCommand = function (outpu
2651
2610
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2652
2611
  return [2, deserializeAws_restJson1UpdateReplicationSetCommandError(output, context)];
2653
2612
  }
2654
- contents = {
2613
+ contents = map({
2655
2614
  $metadata: deserializeMetadata(output),
2656
- };
2615
+ });
2657
2616
  return [4, collectBody(output.body, context)];
2658
2617
  case 1:
2659
2618
  _a.sent();
2660
- return [2, Promise.resolve(contents)];
2619
+ return [2, contents];
2661
2620
  }
2662
2621
  });
2663
2622
  }); };
2664
2623
  var deserializeAws_restJson1UpdateReplicationSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2665
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2624
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2666
2625
  var _c;
2667
2626
  return __generator(this, function (_d) {
2668
2627
  switch (_d.label) {
@@ -2703,14 +2662,14 @@ var deserializeAws_restJson1UpdateReplicationSetCommandError = function (output,
2703
2662
  case 13: throw _d.sent();
2704
2663
  case 14:
2705
2664
  parsedBody = parsedOutput.body;
2706
- $metadata = deserializeMetadata(output);
2707
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2708
- response = new __BaseException({
2709
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2710
- $fault: "client",
2711
- $metadata: $metadata,
2665
+ throwDefaultError({
2666
+ output: output,
2667
+ parsedBody: parsedBody,
2668
+ exceptionCtor: __BaseException,
2669
+ errorCode: errorCode,
2712
2670
  });
2713
- throw __decorateServiceException(response, parsedBody);
2671
+ _d.label = 15;
2672
+ case 15: return [2];
2714
2673
  }
2715
2674
  });
2716
2675
  }); };
@@ -2722,18 +2681,18 @@ export var deserializeAws_restJson1UpdateResponsePlanCommand = function (output,
2722
2681
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2723
2682
  return [2, deserializeAws_restJson1UpdateResponsePlanCommandError(output, context)];
2724
2683
  }
2725
- contents = {
2684
+ contents = map({
2726
2685
  $metadata: deserializeMetadata(output),
2727
- };
2686
+ });
2728
2687
  return [4, collectBody(output.body, context)];
2729
2688
  case 1:
2730
2689
  _a.sent();
2731
- return [2, Promise.resolve(contents)];
2690
+ return [2, contents];
2732
2691
  }
2733
2692
  });
2734
2693
  }); };
2735
2694
  var deserializeAws_restJson1UpdateResponsePlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2736
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2695
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2737
2696
  var _c;
2738
2697
  return __generator(this, function (_d) {
2739
2698
  switch (_d.label) {
@@ -2774,14 +2733,14 @@ var deserializeAws_restJson1UpdateResponsePlanCommandError = function (output, c
2774
2733
  case 13: throw _d.sent();
2775
2734
  case 14:
2776
2735
  parsedBody = parsedOutput.body;
2777
- $metadata = deserializeMetadata(output);
2778
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2779
- response = new __BaseException({
2780
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2781
- $fault: "client",
2782
- $metadata: $metadata,
2736
+ throwDefaultError({
2737
+ output: output,
2738
+ parsedBody: parsedBody,
2739
+ exceptionCtor: __BaseException,
2740
+ errorCode: errorCode,
2783
2741
  });
2784
- throw __decorateServiceException(response, parsedBody);
2742
+ _d.label = 15;
2743
+ case 15: return [2];
2785
2744
  }
2786
2745
  });
2787
2746
  }); };
@@ -2793,18 +2752,18 @@ export var deserializeAws_restJson1UpdateTimelineEventCommand = function (output
2793
2752
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2794
2753
  return [2, deserializeAws_restJson1UpdateTimelineEventCommandError(output, context)];
2795
2754
  }
2796
- contents = {
2755
+ contents = map({
2797
2756
  $metadata: deserializeMetadata(output),
2798
- };
2757
+ });
2799
2758
  return [4, collectBody(output.body, context)];
2800
2759
  case 1:
2801
2760
  _a.sent();
2802
- return [2, Promise.resolve(contents)];
2761
+ return [2, contents];
2803
2762
  }
2804
2763
  });
2805
2764
  }); };
2806
2765
  var deserializeAws_restJson1UpdateTimelineEventCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2807
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2766
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2808
2767
  var _c;
2809
2768
  return __generator(this, function (_d) {
2810
2769
  switch (_d.label) {
@@ -2845,23 +2804,24 @@ var deserializeAws_restJson1UpdateTimelineEventCommandError = function (output,
2845
2804
  case 13: throw _d.sent();
2846
2805
  case 14:
2847
2806
  parsedBody = parsedOutput.body;
2848
- $metadata = deserializeMetadata(output);
2849
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2850
- response = new __BaseException({
2851
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2852
- $fault: "client",
2853
- $metadata: $metadata,
2807
+ throwDefaultError({
2808
+ output: output,
2809
+ parsedBody: parsedBody,
2810
+ exceptionCtor: __BaseException,
2811
+ errorCode: errorCode,
2854
2812
  });
2855
- throw __decorateServiceException(response, parsedBody);
2813
+ _d.label = 15;
2814
+ case 15: return [2];
2856
2815
  }
2857
2816
  });
2858
2817
  }); };
2818
+ var map = __map;
2859
2819
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2860
2820
  var contents, data, exception;
2861
2821
  return __generator(this, function (_a) {
2862
- contents = {};
2822
+ contents = map({});
2863
2823
  data = parsedOutput.body;
2864
- if (data.message !== undefined && data.message !== null) {
2824
+ if (data.message != null) {
2865
2825
  contents.message = __expectString(data.message);
2866
2826
  }
2867
2827
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2871,18 +2831,18 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
2871
2831
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2872
2832
  var contents, data, exception;
2873
2833
  return __generator(this, function (_a) {
2874
- contents = {};
2834
+ contents = map({});
2875
2835
  data = parsedOutput.body;
2876
- if (data.message !== undefined && data.message !== null) {
2836
+ if (data.message != null) {
2877
2837
  contents.message = __expectString(data.message);
2878
2838
  }
2879
- if (data.resourceIdentifier !== undefined && data.resourceIdentifier !== null) {
2839
+ if (data.resourceIdentifier != null) {
2880
2840
  contents.resourceIdentifier = __expectString(data.resourceIdentifier);
2881
2841
  }
2882
- if (data.resourceType !== undefined && data.resourceType !== null) {
2842
+ if (data.resourceType != null) {
2883
2843
  contents.resourceType = __expectString(data.resourceType);
2884
2844
  }
2885
- if (data.retryAfter !== undefined && data.retryAfter !== null) {
2845
+ if (data.retryAfter != null) {
2886
2846
  contents.retryAfter = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.retryAfter)));
2887
2847
  }
2888
2848
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2892,9 +2852,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
2892
2852
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2893
2853
  var contents, data, exception;
2894
2854
  return __generator(this, function (_a) {
2895
- contents = {};
2855
+ contents = map({});
2896
2856
  data = parsedOutput.body;
2897
- if (data.message !== undefined && data.message !== null) {
2857
+ if (data.message != null) {
2898
2858
  contents.message = __expectString(data.message);
2899
2859
  }
2900
2860
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2904,15 +2864,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
2904
2864
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2905
2865
  var contents, data, exception;
2906
2866
  return __generator(this, function (_a) {
2907
- contents = {};
2867
+ contents = map({});
2908
2868
  data = parsedOutput.body;
2909
- if (data.message !== undefined && data.message !== null) {
2869
+ if (data.message != null) {
2910
2870
  contents.message = __expectString(data.message);
2911
2871
  }
2912
- if (data.resourceIdentifier !== undefined && data.resourceIdentifier !== null) {
2872
+ if (data.resourceIdentifier != null) {
2913
2873
  contents.resourceIdentifier = __expectString(data.resourceIdentifier);
2914
2874
  }
2915
- if (data.resourceType !== undefined && data.resourceType !== null) {
2875
+ if (data.resourceType != null) {
2916
2876
  contents.resourceType = __expectString(data.resourceType);
2917
2877
  }
2918
2878
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2922,21 +2882,21 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
2922
2882
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2923
2883
  var contents, data, exception;
2924
2884
  return __generator(this, function (_a) {
2925
- contents = {};
2885
+ contents = map({});
2926
2886
  data = parsedOutput.body;
2927
- if (data.message !== undefined && data.message !== null) {
2887
+ if (data.message != null) {
2928
2888
  contents.message = __expectString(data.message);
2929
2889
  }
2930
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2890
+ if (data.quotaCode != null) {
2931
2891
  contents.quotaCode = __expectString(data.quotaCode);
2932
2892
  }
2933
- if (data.resourceIdentifier !== undefined && data.resourceIdentifier !== null) {
2893
+ if (data.resourceIdentifier != null) {
2934
2894
  contents.resourceIdentifier = __expectString(data.resourceIdentifier);
2935
2895
  }
2936
- if (data.resourceType !== undefined && data.resourceType !== null) {
2896
+ if (data.resourceType != null) {
2937
2897
  contents.resourceType = __expectString(data.resourceType);
2938
2898
  }
2939
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2899
+ if (data.serviceCode != null) {
2940
2900
  contents.serviceCode = __expectString(data.serviceCode);
2941
2901
  }
2942
2902
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2946,15 +2906,15 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
2946
2906
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2947
2907
  var contents, data, exception;
2948
2908
  return __generator(this, function (_a) {
2949
- contents = {};
2909
+ contents = map({});
2950
2910
  data = parsedOutput.body;
2951
- if (data.message !== undefined && data.message !== null) {
2911
+ if (data.message != null) {
2952
2912
  contents.message = __expectString(data.message);
2953
2913
  }
2954
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2914
+ if (data.quotaCode != null) {
2955
2915
  contents.quotaCode = __expectString(data.quotaCode);
2956
2916
  }
2957
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2917
+ if (data.serviceCode != null) {
2958
2918
  contents.serviceCode = __expectString(data.serviceCode);
2959
2919
  }
2960
2920
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2964,9 +2924,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
2964
2924
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2965
2925
  var contents, data, exception;
2966
2926
  return __generator(this, function (_a) {
2967
- contents = {};
2927
+ contents = map({});
2968
2928
  data = parsedOutput.body;
2969
- if (data.message !== undefined && data.message !== null) {
2929
+ if (data.message != null) {
2970
2930
  contents.message = __expectString(data.message);
2971
2931
  }
2972
2932
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2983,9 +2943,6 @@ var serializeAws_restJson1ActionsList = function (input, context) {
2983
2943
  return input
2984
2944
  .filter(function (e) { return e != null; })
2985
2945
  .map(function (entry) {
2986
- if (entry === null) {
2987
- return null;
2988
- }
2989
2946
  return serializeAws_restJson1Action(entry, context);
2990
2947
  });
2991
2948
  };
@@ -3003,9 +2960,6 @@ var serializeAws_restJson1ChatbotSnsConfigurationSet = function (input, context)
3003
2960
  return input
3004
2961
  .filter(function (e) { return e != null; })
3005
2962
  .map(function (entry) {
3006
- if (entry === null) {
3007
- return null;
3008
- }
3009
2963
  return entry;
3010
2964
  });
3011
2965
  };
@@ -3050,9 +3004,6 @@ var serializeAws_restJson1EngagementSet = function (input, context) {
3050
3004
  return input
3051
3005
  .filter(function (e) { return e != null; })
3052
3006
  .map(function (entry) {
3053
- if (entry === null) {
3054
- return null;
3055
- }
3056
3007
  return entry;
3057
3008
  });
3058
3009
  };
@@ -3063,9 +3014,6 @@ var serializeAws_restJson1FilterList = function (input, context) {
3063
3014
  return input
3064
3015
  .filter(function (e) { return e != null; })
3065
3016
  .map(function (entry) {
3066
- if (entry === null) {
3067
- return null;
3068
- }
3069
3017
  return serializeAws_restJson1Filter(entry, context);
3070
3018
  });
3071
3019
  };
@@ -3078,9 +3026,6 @@ var serializeAws_restJson1IntegerList = function (input, context) {
3078
3026
  return input
3079
3027
  .filter(function (e) { return e != null; })
3080
3028
  .map(function (entry) {
3081
- if (entry === null) {
3082
- return null;
3083
- }
3084
3029
  return entry;
3085
3030
  });
3086
3031
  };
@@ -3105,9 +3050,6 @@ var serializeAws_restJson1NotificationTargetSet = function (input, context) {
3105
3050
  return input
3106
3051
  .filter(function (e) { return e != null; })
3107
3052
  .map(function (entry) {
3108
- if (entry === null) {
3109
- return null;
3110
- }
3111
3053
  return serializeAws_restJson1NotificationTargetItem(entry, context);
3112
3054
  });
3113
3055
  };
@@ -3131,9 +3073,6 @@ var serializeAws_restJson1RelatedItemList = function (input, context) {
3131
3073
  return input
3132
3074
  .filter(function (e) { return e != null; })
3133
3075
  .map(function (entry) {
3134
- if (entry === null) {
3135
- return null;
3136
- }
3137
3076
  return serializeAws_restJson1RelatedItem(entry, context);
3138
3077
  });
3139
3078
  };
@@ -3163,9 +3102,6 @@ var serializeAws_restJson1SsmParameterValues = function (input, context) {
3163
3102
  return input
3164
3103
  .filter(function (e) { return e != null; })
3165
3104
  .map(function (entry) {
3166
- if (entry === null) {
3167
- return null;
3168
- }
3169
3105
  return entry;
3170
3106
  });
3171
3107
  };
@@ -3173,9 +3109,6 @@ var serializeAws_restJson1StringList = function (input, context) {
3173
3109
  return input
3174
3110
  .filter(function (e) { return e != null; })
3175
3111
  .map(function (entry) {
3176
- if (entry === null) {
3177
- return null;
3178
- }
3179
3112
  return entry;
3180
3113
  });
3181
3114
  };
@@ -3206,9 +3139,6 @@ var serializeAws_restJson1UpdateActionList = function (input, context) {
3206
3139
  return input
3207
3140
  .filter(function (e) { return e != null; })
3208
3141
  .map(function (entry) {
3209
- if (entry === null) {
3210
- return null;
3211
- }
3212
3142
  return serializeAws_restJson1UpdateReplicationSetAction(entry, context);
3213
3143
  });
3214
3144
  };
@@ -3220,7 +3150,7 @@ var serializeAws_restJson1UpdateReplicationSetAction = function (input, context)
3220
3150
  });
3221
3151
  };
3222
3152
  var deserializeAws_restJson1Action = function (output, context) {
3223
- if (output.ssmAutomation !== undefined && output.ssmAutomation !== null) {
3153
+ if (output.ssmAutomation != null) {
3224
3154
  return {
3225
3155
  ssmAutomation: deserializeAws_restJson1SsmAutomation(output.ssmAutomation, context),
3226
3156
  };
@@ -3267,12 +3197,12 @@ var deserializeAws_restJson1ChatbotSnsConfigurationSet = function (output, conte
3267
3197
  return retVal;
3268
3198
  };
3269
3199
  var deserializeAws_restJson1ChatChannel = function (output, context) {
3270
- if (output.chatbotSns !== undefined && output.chatbotSns !== null) {
3200
+ if (output.chatbotSns != null) {
3271
3201
  return {
3272
3202
  chatbotSns: deserializeAws_restJson1ChatbotSnsConfigurationSet(output.chatbotSns, context),
3273
3203
  };
3274
3204
  }
3275
- if (output.empty !== undefined && output.empty !== null) {
3205
+ if (output.empty != null) {
3276
3206
  return {
3277
3207
  empty: deserializeAws_restJson1EmptyChatChannel(output.empty, context),
3278
3208
  };