@aws-sdk/client-xray 3.131.0 → 3.142.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/BatchGetTracesCommand.js +2 -2
  4. package/dist-cjs/commands/CreateGroupCommand.js +2 -2
  5. package/dist-cjs/commands/CreateSamplingRuleCommand.js +2 -2
  6. package/dist-cjs/commands/DeleteGroupCommand.js +2 -2
  7. package/dist-cjs/commands/DeleteSamplingRuleCommand.js +2 -2
  8. package/dist-cjs/commands/GetEncryptionConfigCommand.js +2 -2
  9. package/dist-cjs/commands/GetGroupCommand.js +2 -2
  10. package/dist-cjs/commands/GetGroupsCommand.js +2 -2
  11. package/dist-cjs/commands/GetInsightCommand.js +2 -2
  12. package/dist-cjs/commands/GetInsightEventsCommand.js +2 -2
  13. package/dist-cjs/commands/GetInsightImpactGraphCommand.js +2 -2
  14. package/dist-cjs/commands/GetInsightSummariesCommand.js +2 -2
  15. package/dist-cjs/commands/GetSamplingRulesCommand.js +2 -2
  16. package/dist-cjs/commands/GetSamplingStatisticSummariesCommand.js +2 -2
  17. package/dist-cjs/commands/GetSamplingTargetsCommand.js +2 -2
  18. package/dist-cjs/commands/GetServiceGraphCommand.js +2 -2
  19. package/dist-cjs/commands/GetTimeSeriesServiceStatisticsCommand.js +2 -2
  20. package/dist-cjs/commands/GetTraceGraphCommand.js +2 -2
  21. package/dist-cjs/commands/GetTraceSummariesCommand.js +2 -2
  22. package/dist-cjs/commands/ListTagsForResourceCommand.js +2 -2
  23. package/dist-cjs/commands/PutEncryptionConfigCommand.js +2 -2
  24. package/dist-cjs/commands/PutTelemetryRecordsCommand.js +2 -2
  25. package/dist-cjs/commands/PutTraceSegmentsCommand.js +2 -2
  26. package/dist-cjs/commands/TagResourceCommand.js +2 -2
  27. package/dist-cjs/commands/UntagResourceCommand.js +2 -2
  28. package/dist-cjs/commands/UpdateGroupCommand.js +2 -2
  29. package/dist-cjs/commands/UpdateSamplingRuleCommand.js +2 -2
  30. package/dist-cjs/models/models_0.js +449 -662
  31. package/dist-cjs/protocols/Aws_restJson1.js +278 -428
  32. package/dist-es/commands/BatchGetTracesCommand.js +3 -3
  33. package/dist-es/commands/CreateGroupCommand.js +3 -3
  34. package/dist-es/commands/CreateSamplingRuleCommand.js +3 -3
  35. package/dist-es/commands/DeleteGroupCommand.js +3 -3
  36. package/dist-es/commands/DeleteSamplingRuleCommand.js +3 -3
  37. package/dist-es/commands/GetEncryptionConfigCommand.js +3 -3
  38. package/dist-es/commands/GetGroupCommand.js +3 -3
  39. package/dist-es/commands/GetGroupsCommand.js +3 -3
  40. package/dist-es/commands/GetInsightCommand.js +3 -3
  41. package/dist-es/commands/GetInsightEventsCommand.js +3 -3
  42. package/dist-es/commands/GetInsightImpactGraphCommand.js +3 -3
  43. package/dist-es/commands/GetInsightSummariesCommand.js +3 -3
  44. package/dist-es/commands/GetSamplingRulesCommand.js +3 -3
  45. package/dist-es/commands/GetSamplingStatisticSummariesCommand.js +3 -3
  46. package/dist-es/commands/GetSamplingTargetsCommand.js +3 -3
  47. package/dist-es/commands/GetServiceGraphCommand.js +3 -3
  48. package/dist-es/commands/GetTimeSeriesServiceStatisticsCommand.js +3 -3
  49. package/dist-es/commands/GetTraceGraphCommand.js +3 -3
  50. package/dist-es/commands/GetTraceSummariesCommand.js +3 -3
  51. package/dist-es/commands/ListTagsForResourceCommand.js +3 -3
  52. package/dist-es/commands/PutEncryptionConfigCommand.js +3 -3
  53. package/dist-es/commands/PutTelemetryRecordsCommand.js +3 -3
  54. package/dist-es/commands/PutTraceSegmentsCommand.js +3 -3
  55. package/dist-es/commands/TagResourceCommand.js +3 -3
  56. package/dist-es/commands/UntagResourceCommand.js +3 -3
  57. package/dist-es/commands/UpdateGroupCommand.js +3 -3
  58. package/dist-es/commands/UpdateSamplingRuleCommand.js +3 -3
  59. package/dist-es/models/models_0.js +124 -445
  60. package/dist-es/protocols/Aws_restJson1.js +360 -429
  61. package/dist-types/models/models_0.d.ts +432 -646
  62. package/dist-types/ts3.4/models/models_0.d.ts +216 -430
  63. package/package.json +6 -6
@@ -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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { InvalidRequestException, ResourceNotFoundException, RuleLimitExceededException, ThrottledException, TooManyTagsException, } from "../models/models_0";
5
5
  import { XRayServiceException as __BaseException } from "../models/XRayServiceException";
6
6
  export var serializeAws_restJson1BatchGetTracesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -675,32 +675,29 @@ export var deserializeAws_restJson1BatchGetTracesCommand = function (output, con
675
675
  if (output.statusCode !== 200 && output.statusCode >= 300) {
676
676
  return [2, deserializeAws_restJson1BatchGetTracesCommandError(output, context)];
677
677
  }
678
- contents = {
678
+ contents = map({
679
679
  $metadata: deserializeMetadata(output),
680
- NextToken: undefined,
681
- Traces: undefined,
682
- UnprocessedTraceIds: undefined,
683
- };
680
+ });
684
681
  _a = __expectNonNull;
685
682
  _b = __expectObject;
686
683
  return [4, parseBody(output.body, context)];
687
684
  case 1:
688
685
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
689
- if (data.NextToken !== undefined && data.NextToken !== null) {
686
+ if (data.NextToken != null) {
690
687
  contents.NextToken = __expectString(data.NextToken);
691
688
  }
692
- if (data.Traces !== undefined && data.Traces !== null) {
689
+ if (data.Traces != null) {
693
690
  contents.Traces = deserializeAws_restJson1TraceList(data.Traces, context);
694
691
  }
695
- if (data.UnprocessedTraceIds !== undefined && data.UnprocessedTraceIds !== null) {
692
+ if (data.UnprocessedTraceIds != null) {
696
693
  contents.UnprocessedTraceIds = deserializeAws_restJson1UnprocessedTraceIdList(data.UnprocessedTraceIds, context);
697
694
  }
698
- return [2, Promise.resolve(contents)];
695
+ return [2, contents];
699
696
  }
700
697
  });
701
698
  }); };
702
699
  var deserializeAws_restJson1BatchGetTracesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
703
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
700
+ var parsedOutput, _a, errorCode, _b, parsedBody;
704
701
  var _c;
705
702
  return __generator(this, function (_d) {
706
703
  switch (_d.label) {
@@ -725,14 +722,14 @@ var deserializeAws_restJson1BatchGetTracesCommandError = function (output, conte
725
722
  case 5: throw _d.sent();
726
723
  case 6:
727
724
  parsedBody = parsedOutput.body;
728
- $metadata = deserializeMetadata(output);
729
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
730
- response = new __BaseException({
731
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
732
- $fault: "client",
733
- $metadata: $metadata,
725
+ throwDefaultError({
726
+ output: output,
727
+ parsedBody: parsedBody,
728
+ exceptionCtor: __BaseException,
729
+ errorCode: errorCode,
734
730
  });
735
- throw __decorateServiceException(response, parsedBody);
731
+ _d.label = 7;
732
+ case 7: return [2];
736
733
  }
737
734
  });
738
735
  }); };
@@ -744,24 +741,23 @@ export var deserializeAws_restJson1CreateGroupCommand = function (output, contex
744
741
  if (output.statusCode !== 200 && output.statusCode >= 300) {
745
742
  return [2, deserializeAws_restJson1CreateGroupCommandError(output, context)];
746
743
  }
747
- contents = {
744
+ contents = map({
748
745
  $metadata: deserializeMetadata(output),
749
- Group: undefined,
750
- };
746
+ });
751
747
  _a = __expectNonNull;
752
748
  _b = __expectObject;
753
749
  return [4, parseBody(output.body, context)];
754
750
  case 1:
755
751
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
756
- if (data.Group !== undefined && data.Group !== null) {
752
+ if (data.Group != null) {
757
753
  contents.Group = deserializeAws_restJson1Group(data.Group, context);
758
754
  }
759
- return [2, Promise.resolve(contents)];
755
+ return [2, contents];
760
756
  }
761
757
  });
762
758
  }); };
763
759
  var deserializeAws_restJson1CreateGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
764
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
760
+ var parsedOutput, _a, errorCode, _b, parsedBody;
765
761
  var _c;
766
762
  return __generator(this, function (_d) {
767
763
  switch (_d.label) {
@@ -786,14 +782,14 @@ var deserializeAws_restJson1CreateGroupCommandError = function (output, context)
786
782
  case 5: throw _d.sent();
787
783
  case 6:
788
784
  parsedBody = parsedOutput.body;
789
- $metadata = deserializeMetadata(output);
790
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
791
- response = new __BaseException({
792
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
793
- $fault: "client",
794
- $metadata: $metadata,
785
+ throwDefaultError({
786
+ output: output,
787
+ parsedBody: parsedBody,
788
+ exceptionCtor: __BaseException,
789
+ errorCode: errorCode,
795
790
  });
796
- throw __decorateServiceException(response, parsedBody);
791
+ _d.label = 7;
792
+ case 7: return [2];
797
793
  }
798
794
  });
799
795
  }); };
@@ -805,24 +801,23 @@ export var deserializeAws_restJson1CreateSamplingRuleCommand = function (output,
805
801
  if (output.statusCode !== 200 && output.statusCode >= 300) {
806
802
  return [2, deserializeAws_restJson1CreateSamplingRuleCommandError(output, context)];
807
803
  }
808
- contents = {
804
+ contents = map({
809
805
  $metadata: deserializeMetadata(output),
810
- SamplingRuleRecord: undefined,
811
- };
806
+ });
812
807
  _a = __expectNonNull;
813
808
  _b = __expectObject;
814
809
  return [4, parseBody(output.body, context)];
815
810
  case 1:
816
811
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
817
- if (data.SamplingRuleRecord !== undefined && data.SamplingRuleRecord !== null) {
812
+ if (data.SamplingRuleRecord != null) {
818
813
  contents.SamplingRuleRecord = deserializeAws_restJson1SamplingRuleRecord(data.SamplingRuleRecord, context);
819
814
  }
820
- return [2, Promise.resolve(contents)];
815
+ return [2, contents];
821
816
  }
822
817
  });
823
818
  }); };
824
819
  var deserializeAws_restJson1CreateSamplingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
825
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
820
+ var parsedOutput, _a, errorCode, _b, parsedBody;
826
821
  var _c;
827
822
  return __generator(this, function (_d) {
828
823
  switch (_d.label) {
@@ -851,14 +846,14 @@ var deserializeAws_restJson1CreateSamplingRuleCommandError = function (output, c
851
846
  case 7: throw _d.sent();
852
847
  case 8:
853
848
  parsedBody = parsedOutput.body;
854
- $metadata = deserializeMetadata(output);
855
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
856
- response = new __BaseException({
857
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
858
- $fault: "client",
859
- $metadata: $metadata,
849
+ throwDefaultError({
850
+ output: output,
851
+ parsedBody: parsedBody,
852
+ exceptionCtor: __BaseException,
853
+ errorCode: errorCode,
860
854
  });
861
- throw __decorateServiceException(response, parsedBody);
855
+ _d.label = 9;
856
+ case 9: return [2];
862
857
  }
863
858
  });
864
859
  }); };
@@ -870,18 +865,18 @@ export var deserializeAws_restJson1DeleteGroupCommand = function (output, contex
870
865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
871
866
  return [2, deserializeAws_restJson1DeleteGroupCommandError(output, context)];
872
867
  }
873
- contents = {
868
+ contents = map({
874
869
  $metadata: deserializeMetadata(output),
875
- };
870
+ });
876
871
  return [4, collectBody(output.body, context)];
877
872
  case 1:
878
873
  _a.sent();
879
- return [2, Promise.resolve(contents)];
874
+ return [2, contents];
880
875
  }
881
876
  });
882
877
  }); };
883
878
  var deserializeAws_restJson1DeleteGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
884
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
879
+ var parsedOutput, _a, errorCode, _b, parsedBody;
885
880
  var _c;
886
881
  return __generator(this, function (_d) {
887
882
  switch (_d.label) {
@@ -906,14 +901,14 @@ var deserializeAws_restJson1DeleteGroupCommandError = function (output, context)
906
901
  case 5: throw _d.sent();
907
902
  case 6:
908
903
  parsedBody = parsedOutput.body;
909
- $metadata = deserializeMetadata(output);
910
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
911
- response = new __BaseException({
912
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
913
- $fault: "client",
914
- $metadata: $metadata,
904
+ throwDefaultError({
905
+ output: output,
906
+ parsedBody: parsedBody,
907
+ exceptionCtor: __BaseException,
908
+ errorCode: errorCode,
915
909
  });
916
- throw __decorateServiceException(response, parsedBody);
910
+ _d.label = 7;
911
+ case 7: return [2];
917
912
  }
918
913
  });
919
914
  }); };
@@ -925,24 +920,23 @@ export var deserializeAws_restJson1DeleteSamplingRuleCommand = function (output,
925
920
  if (output.statusCode !== 200 && output.statusCode >= 300) {
926
921
  return [2, deserializeAws_restJson1DeleteSamplingRuleCommandError(output, context)];
927
922
  }
928
- contents = {
923
+ contents = map({
929
924
  $metadata: deserializeMetadata(output),
930
- SamplingRuleRecord: undefined,
931
- };
925
+ });
932
926
  _a = __expectNonNull;
933
927
  _b = __expectObject;
934
928
  return [4, parseBody(output.body, context)];
935
929
  case 1:
936
930
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
937
- if (data.SamplingRuleRecord !== undefined && data.SamplingRuleRecord !== null) {
931
+ if (data.SamplingRuleRecord != null) {
938
932
  contents.SamplingRuleRecord = deserializeAws_restJson1SamplingRuleRecord(data.SamplingRuleRecord, context);
939
933
  }
940
- return [2, Promise.resolve(contents)];
934
+ return [2, contents];
941
935
  }
942
936
  });
943
937
  }); };
944
938
  var deserializeAws_restJson1DeleteSamplingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
945
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
939
+ var parsedOutput, _a, errorCode, _b, parsedBody;
946
940
  var _c;
947
941
  return __generator(this, function (_d) {
948
942
  switch (_d.label) {
@@ -967,14 +961,14 @@ var deserializeAws_restJson1DeleteSamplingRuleCommandError = function (output, c
967
961
  case 5: throw _d.sent();
968
962
  case 6:
969
963
  parsedBody = parsedOutput.body;
970
- $metadata = deserializeMetadata(output);
971
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
972
- response = new __BaseException({
973
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
974
- $fault: "client",
975
- $metadata: $metadata,
964
+ throwDefaultError({
965
+ output: output,
966
+ parsedBody: parsedBody,
967
+ exceptionCtor: __BaseException,
968
+ errorCode: errorCode,
976
969
  });
977
- throw __decorateServiceException(response, parsedBody);
970
+ _d.label = 7;
971
+ case 7: return [2];
978
972
  }
979
973
  });
980
974
  }); };
@@ -986,24 +980,23 @@ export var deserializeAws_restJson1GetEncryptionConfigCommand = function (output
986
980
  if (output.statusCode !== 200 && output.statusCode >= 300) {
987
981
  return [2, deserializeAws_restJson1GetEncryptionConfigCommandError(output, context)];
988
982
  }
989
- contents = {
983
+ contents = map({
990
984
  $metadata: deserializeMetadata(output),
991
- EncryptionConfig: undefined,
992
- };
985
+ });
993
986
  _a = __expectNonNull;
994
987
  _b = __expectObject;
995
988
  return [4, parseBody(output.body, context)];
996
989
  case 1:
997
990
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
998
- if (data.EncryptionConfig !== undefined && data.EncryptionConfig !== null) {
991
+ if (data.EncryptionConfig != null) {
999
992
  contents.EncryptionConfig = deserializeAws_restJson1EncryptionConfig(data.EncryptionConfig, context);
1000
993
  }
1001
- return [2, Promise.resolve(contents)];
994
+ return [2, contents];
1002
995
  }
1003
996
  });
1004
997
  }); };
1005
998
  var deserializeAws_restJson1GetEncryptionConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1006
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
999
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1007
1000
  var _c;
1008
1001
  return __generator(this, function (_d) {
1009
1002
  switch (_d.label) {
@@ -1028,14 +1021,14 @@ var deserializeAws_restJson1GetEncryptionConfigCommandError = function (output,
1028
1021
  case 5: throw _d.sent();
1029
1022
  case 6:
1030
1023
  parsedBody = parsedOutput.body;
1031
- $metadata = deserializeMetadata(output);
1032
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1033
- response = new __BaseException({
1034
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1035
- $fault: "client",
1036
- $metadata: $metadata,
1024
+ throwDefaultError({
1025
+ output: output,
1026
+ parsedBody: parsedBody,
1027
+ exceptionCtor: __BaseException,
1028
+ errorCode: errorCode,
1037
1029
  });
1038
- throw __decorateServiceException(response, parsedBody);
1030
+ _d.label = 7;
1031
+ case 7: return [2];
1039
1032
  }
1040
1033
  });
1041
1034
  }); };
@@ -1047,24 +1040,23 @@ export var deserializeAws_restJson1GetGroupCommand = function (output, context)
1047
1040
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1048
1041
  return [2, deserializeAws_restJson1GetGroupCommandError(output, context)];
1049
1042
  }
1050
- contents = {
1043
+ contents = map({
1051
1044
  $metadata: deserializeMetadata(output),
1052
- Group: undefined,
1053
- };
1045
+ });
1054
1046
  _a = __expectNonNull;
1055
1047
  _b = __expectObject;
1056
1048
  return [4, parseBody(output.body, context)];
1057
1049
  case 1:
1058
1050
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1059
- if (data.Group !== undefined && data.Group !== null) {
1051
+ if (data.Group != null) {
1060
1052
  contents.Group = deserializeAws_restJson1Group(data.Group, context);
1061
1053
  }
1062
- return [2, Promise.resolve(contents)];
1054
+ return [2, contents];
1063
1055
  }
1064
1056
  });
1065
1057
  }); };
1066
1058
  var deserializeAws_restJson1GetGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1067
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1059
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1068
1060
  var _c;
1069
1061
  return __generator(this, function (_d) {
1070
1062
  switch (_d.label) {
@@ -1089,14 +1081,14 @@ var deserializeAws_restJson1GetGroupCommandError = function (output, context) {
1089
1081
  case 5: throw _d.sent();
1090
1082
  case 6:
1091
1083
  parsedBody = parsedOutput.body;
1092
- $metadata = deserializeMetadata(output);
1093
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1094
- response = new __BaseException({
1095
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1096
- $fault: "client",
1097
- $metadata: $metadata,
1084
+ throwDefaultError({
1085
+ output: output,
1086
+ parsedBody: parsedBody,
1087
+ exceptionCtor: __BaseException,
1088
+ errorCode: errorCode,
1098
1089
  });
1099
- throw __decorateServiceException(response, parsedBody);
1090
+ _d.label = 7;
1091
+ case 7: return [2];
1100
1092
  }
1101
1093
  });
1102
1094
  }); };
@@ -1108,28 +1100,26 @@ export var deserializeAws_restJson1GetGroupsCommand = function (output, context)
1108
1100
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1109
1101
  return [2, deserializeAws_restJson1GetGroupsCommandError(output, context)];
1110
1102
  }
1111
- contents = {
1103
+ contents = map({
1112
1104
  $metadata: deserializeMetadata(output),
1113
- Groups: undefined,
1114
- NextToken: undefined,
1115
- };
1105
+ });
1116
1106
  _a = __expectNonNull;
1117
1107
  _b = __expectObject;
1118
1108
  return [4, parseBody(output.body, context)];
1119
1109
  case 1:
1120
1110
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1121
- if (data.Groups !== undefined && data.Groups !== null) {
1111
+ if (data.Groups != null) {
1122
1112
  contents.Groups = deserializeAws_restJson1GroupSummaryList(data.Groups, context);
1123
1113
  }
1124
- if (data.NextToken !== undefined && data.NextToken !== null) {
1114
+ if (data.NextToken != null) {
1125
1115
  contents.NextToken = __expectString(data.NextToken);
1126
1116
  }
1127
- return [2, Promise.resolve(contents)];
1117
+ return [2, contents];
1128
1118
  }
1129
1119
  });
1130
1120
  }); };
1131
1121
  var deserializeAws_restJson1GetGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1132
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1122
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1133
1123
  var _c;
1134
1124
  return __generator(this, function (_d) {
1135
1125
  switch (_d.label) {
@@ -1154,14 +1144,14 @@ var deserializeAws_restJson1GetGroupsCommandError = function (output, context) {
1154
1144
  case 5: throw _d.sent();
1155
1145
  case 6:
1156
1146
  parsedBody = parsedOutput.body;
1157
- $metadata = deserializeMetadata(output);
1158
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1159
- response = new __BaseException({
1160
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1161
- $fault: "client",
1162
- $metadata: $metadata,
1147
+ throwDefaultError({
1148
+ output: output,
1149
+ parsedBody: parsedBody,
1150
+ exceptionCtor: __BaseException,
1151
+ errorCode: errorCode,
1163
1152
  });
1164
- throw __decorateServiceException(response, parsedBody);
1153
+ _d.label = 7;
1154
+ case 7: return [2];
1165
1155
  }
1166
1156
  });
1167
1157
  }); };
@@ -1173,24 +1163,23 @@ export var deserializeAws_restJson1GetInsightCommand = function (output, context
1173
1163
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1174
1164
  return [2, deserializeAws_restJson1GetInsightCommandError(output, context)];
1175
1165
  }
1176
- contents = {
1166
+ contents = map({
1177
1167
  $metadata: deserializeMetadata(output),
1178
- Insight: undefined,
1179
- };
1168
+ });
1180
1169
  _a = __expectNonNull;
1181
1170
  _b = __expectObject;
1182
1171
  return [4, parseBody(output.body, context)];
1183
1172
  case 1:
1184
1173
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1185
- if (data.Insight !== undefined && data.Insight !== null) {
1174
+ if (data.Insight != null) {
1186
1175
  contents.Insight = deserializeAws_restJson1Insight(data.Insight, context);
1187
1176
  }
1188
- return [2, Promise.resolve(contents)];
1177
+ return [2, contents];
1189
1178
  }
1190
1179
  });
1191
1180
  }); };
1192
1181
  var deserializeAws_restJson1GetInsightCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1193
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1182
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1194
1183
  var _c;
1195
1184
  return __generator(this, function (_d) {
1196
1185
  switch (_d.label) {
@@ -1215,14 +1204,14 @@ var deserializeAws_restJson1GetInsightCommandError = function (output, context)
1215
1204
  case 5: throw _d.sent();
1216
1205
  case 6:
1217
1206
  parsedBody = parsedOutput.body;
1218
- $metadata = deserializeMetadata(output);
1219
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1220
- response = new __BaseException({
1221
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1222
- $fault: "client",
1223
- $metadata: $metadata,
1207
+ throwDefaultError({
1208
+ output: output,
1209
+ parsedBody: parsedBody,
1210
+ exceptionCtor: __BaseException,
1211
+ errorCode: errorCode,
1224
1212
  });
1225
- throw __decorateServiceException(response, parsedBody);
1213
+ _d.label = 7;
1214
+ case 7: return [2];
1226
1215
  }
1227
1216
  });
1228
1217
  }); };
@@ -1234,28 +1223,26 @@ export var deserializeAws_restJson1GetInsightEventsCommand = function (output, c
1234
1223
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1235
1224
  return [2, deserializeAws_restJson1GetInsightEventsCommandError(output, context)];
1236
1225
  }
1237
- contents = {
1226
+ contents = map({
1238
1227
  $metadata: deserializeMetadata(output),
1239
- InsightEvents: undefined,
1240
- NextToken: undefined,
1241
- };
1228
+ });
1242
1229
  _a = __expectNonNull;
1243
1230
  _b = __expectObject;
1244
1231
  return [4, parseBody(output.body, context)];
1245
1232
  case 1:
1246
1233
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1247
- if (data.InsightEvents !== undefined && data.InsightEvents !== null) {
1234
+ if (data.InsightEvents != null) {
1248
1235
  contents.InsightEvents = deserializeAws_restJson1InsightEventList(data.InsightEvents, context);
1249
1236
  }
1250
- if (data.NextToken !== undefined && data.NextToken !== null) {
1237
+ if (data.NextToken != null) {
1251
1238
  contents.NextToken = __expectString(data.NextToken);
1252
1239
  }
1253
- return [2, Promise.resolve(contents)];
1240
+ return [2, contents];
1254
1241
  }
1255
1242
  });
1256
1243
  }); };
1257
1244
  var deserializeAws_restJson1GetInsightEventsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1258
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1245
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1259
1246
  var _c;
1260
1247
  return __generator(this, function (_d) {
1261
1248
  switch (_d.label) {
@@ -1280,14 +1267,14 @@ var deserializeAws_restJson1GetInsightEventsCommandError = function (output, con
1280
1267
  case 5: throw _d.sent();
1281
1268
  case 6:
1282
1269
  parsedBody = parsedOutput.body;
1283
- $metadata = deserializeMetadata(output);
1284
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1285
- response = new __BaseException({
1286
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1287
- $fault: "client",
1288
- $metadata: $metadata,
1270
+ throwDefaultError({
1271
+ output: output,
1272
+ parsedBody: parsedBody,
1273
+ exceptionCtor: __BaseException,
1274
+ errorCode: errorCode,
1289
1275
  });
1290
- throw __decorateServiceException(response, parsedBody);
1276
+ _d.label = 7;
1277
+ case 7: return [2];
1291
1278
  }
1292
1279
  });
1293
1280
  }); };
@@ -1299,48 +1286,41 @@ export var deserializeAws_restJson1GetInsightImpactGraphCommand = function (outp
1299
1286
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1300
1287
  return [2, deserializeAws_restJson1GetInsightImpactGraphCommandError(output, context)];
1301
1288
  }
1302
- contents = {
1289
+ contents = map({
1303
1290
  $metadata: deserializeMetadata(output),
1304
- EndTime: undefined,
1305
- InsightId: undefined,
1306
- NextToken: undefined,
1307
- ServiceGraphEndTime: undefined,
1308
- ServiceGraphStartTime: undefined,
1309
- Services: undefined,
1310
- StartTime: undefined,
1311
- };
1291
+ });
1312
1292
  _a = __expectNonNull;
1313
1293
  _b = __expectObject;
1314
1294
  return [4, parseBody(output.body, context)];
1315
1295
  case 1:
1316
1296
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1317
- if (data.EndTime !== undefined && data.EndTime !== null) {
1297
+ if (data.EndTime != null) {
1318
1298
  contents.EndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.EndTime)));
1319
1299
  }
1320
- if (data.InsightId !== undefined && data.InsightId !== null) {
1300
+ if (data.InsightId != null) {
1321
1301
  contents.InsightId = __expectString(data.InsightId);
1322
1302
  }
1323
- if (data.NextToken !== undefined && data.NextToken !== null) {
1303
+ if (data.NextToken != null) {
1324
1304
  contents.NextToken = __expectString(data.NextToken);
1325
1305
  }
1326
- if (data.ServiceGraphEndTime !== undefined && data.ServiceGraphEndTime !== null) {
1306
+ if (data.ServiceGraphEndTime != null) {
1327
1307
  contents.ServiceGraphEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ServiceGraphEndTime)));
1328
1308
  }
1329
- if (data.ServiceGraphStartTime !== undefined && data.ServiceGraphStartTime !== null) {
1309
+ if (data.ServiceGraphStartTime != null) {
1330
1310
  contents.ServiceGraphStartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ServiceGraphStartTime)));
1331
1311
  }
1332
- if (data.Services !== undefined && data.Services !== null) {
1312
+ if (data.Services != null) {
1333
1313
  contents.Services = deserializeAws_restJson1InsightImpactGraphServiceList(data.Services, context);
1334
1314
  }
1335
- if (data.StartTime !== undefined && data.StartTime !== null) {
1315
+ if (data.StartTime != null) {
1336
1316
  contents.StartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.StartTime)));
1337
1317
  }
1338
- return [2, Promise.resolve(contents)];
1318
+ return [2, contents];
1339
1319
  }
1340
1320
  });
1341
1321
  }); };
1342
1322
  var deserializeAws_restJson1GetInsightImpactGraphCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1343
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1323
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1344
1324
  var _c;
1345
1325
  return __generator(this, function (_d) {
1346
1326
  switch (_d.label) {
@@ -1365,14 +1345,14 @@ var deserializeAws_restJson1GetInsightImpactGraphCommandError = function (output
1365
1345
  case 5: throw _d.sent();
1366
1346
  case 6:
1367
1347
  parsedBody = parsedOutput.body;
1368
- $metadata = deserializeMetadata(output);
1369
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1370
- response = new __BaseException({
1371
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1372
- $fault: "client",
1373
- $metadata: $metadata,
1348
+ throwDefaultError({
1349
+ output: output,
1350
+ parsedBody: parsedBody,
1351
+ exceptionCtor: __BaseException,
1352
+ errorCode: errorCode,
1374
1353
  });
1375
- throw __decorateServiceException(response, parsedBody);
1354
+ _d.label = 7;
1355
+ case 7: return [2];
1376
1356
  }
1377
1357
  });
1378
1358
  }); };
@@ -1384,28 +1364,26 @@ export var deserializeAws_restJson1GetInsightSummariesCommand = function (output
1384
1364
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1385
1365
  return [2, deserializeAws_restJson1GetInsightSummariesCommandError(output, context)];
1386
1366
  }
1387
- contents = {
1367
+ contents = map({
1388
1368
  $metadata: deserializeMetadata(output),
1389
- InsightSummaries: undefined,
1390
- NextToken: undefined,
1391
- };
1369
+ });
1392
1370
  _a = __expectNonNull;
1393
1371
  _b = __expectObject;
1394
1372
  return [4, parseBody(output.body, context)];
1395
1373
  case 1:
1396
1374
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1397
- if (data.InsightSummaries !== undefined && data.InsightSummaries !== null) {
1375
+ if (data.InsightSummaries != null) {
1398
1376
  contents.InsightSummaries = deserializeAws_restJson1InsightSummaryList(data.InsightSummaries, context);
1399
1377
  }
1400
- if (data.NextToken !== undefined && data.NextToken !== null) {
1378
+ if (data.NextToken != null) {
1401
1379
  contents.NextToken = __expectString(data.NextToken);
1402
1380
  }
1403
- return [2, Promise.resolve(contents)];
1381
+ return [2, contents];
1404
1382
  }
1405
1383
  });
1406
1384
  }); };
1407
1385
  var deserializeAws_restJson1GetInsightSummariesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1408
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1386
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1409
1387
  var _c;
1410
1388
  return __generator(this, function (_d) {
1411
1389
  switch (_d.label) {
@@ -1430,14 +1408,14 @@ var deserializeAws_restJson1GetInsightSummariesCommandError = function (output,
1430
1408
  case 5: throw _d.sent();
1431
1409
  case 6:
1432
1410
  parsedBody = parsedOutput.body;
1433
- $metadata = deserializeMetadata(output);
1434
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1435
- response = new __BaseException({
1436
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1437
- $fault: "client",
1438
- $metadata: $metadata,
1411
+ throwDefaultError({
1412
+ output: output,
1413
+ parsedBody: parsedBody,
1414
+ exceptionCtor: __BaseException,
1415
+ errorCode: errorCode,
1439
1416
  });
1440
- throw __decorateServiceException(response, parsedBody);
1417
+ _d.label = 7;
1418
+ case 7: return [2];
1441
1419
  }
1442
1420
  });
1443
1421
  }); };
@@ -1449,28 +1427,26 @@ export var deserializeAws_restJson1GetSamplingRulesCommand = function (output, c
1449
1427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1450
1428
  return [2, deserializeAws_restJson1GetSamplingRulesCommandError(output, context)];
1451
1429
  }
1452
- contents = {
1430
+ contents = map({
1453
1431
  $metadata: deserializeMetadata(output),
1454
- NextToken: undefined,
1455
- SamplingRuleRecords: undefined,
1456
- };
1432
+ });
1457
1433
  _a = __expectNonNull;
1458
1434
  _b = __expectObject;
1459
1435
  return [4, parseBody(output.body, context)];
1460
1436
  case 1:
1461
1437
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1462
- if (data.NextToken !== undefined && data.NextToken !== null) {
1438
+ if (data.NextToken != null) {
1463
1439
  contents.NextToken = __expectString(data.NextToken);
1464
1440
  }
1465
- if (data.SamplingRuleRecords !== undefined && data.SamplingRuleRecords !== null) {
1441
+ if (data.SamplingRuleRecords != null) {
1466
1442
  contents.SamplingRuleRecords = deserializeAws_restJson1SamplingRuleRecordList(data.SamplingRuleRecords, context);
1467
1443
  }
1468
- return [2, Promise.resolve(contents)];
1444
+ return [2, contents];
1469
1445
  }
1470
1446
  });
1471
1447
  }); };
1472
1448
  var deserializeAws_restJson1GetSamplingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1473
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1449
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1474
1450
  var _c;
1475
1451
  return __generator(this, function (_d) {
1476
1452
  switch (_d.label) {
@@ -1495,14 +1471,14 @@ var deserializeAws_restJson1GetSamplingRulesCommandError = function (output, con
1495
1471
  case 5: throw _d.sent();
1496
1472
  case 6:
1497
1473
  parsedBody = parsedOutput.body;
1498
- $metadata = deserializeMetadata(output);
1499
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1500
- response = new __BaseException({
1501
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1502
- $fault: "client",
1503
- $metadata: $metadata,
1474
+ throwDefaultError({
1475
+ output: output,
1476
+ parsedBody: parsedBody,
1477
+ exceptionCtor: __BaseException,
1478
+ errorCode: errorCode,
1504
1479
  });
1505
- throw __decorateServiceException(response, parsedBody);
1480
+ _d.label = 7;
1481
+ case 7: return [2];
1506
1482
  }
1507
1483
  });
1508
1484
  }); };
@@ -1514,28 +1490,26 @@ export var deserializeAws_restJson1GetSamplingStatisticSummariesCommand = functi
1514
1490
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1515
1491
  return [2, deserializeAws_restJson1GetSamplingStatisticSummariesCommandError(output, context)];
1516
1492
  }
1517
- contents = {
1493
+ contents = map({
1518
1494
  $metadata: deserializeMetadata(output),
1519
- NextToken: undefined,
1520
- SamplingStatisticSummaries: undefined,
1521
- };
1495
+ });
1522
1496
  _a = __expectNonNull;
1523
1497
  _b = __expectObject;
1524
1498
  return [4, parseBody(output.body, context)];
1525
1499
  case 1:
1526
1500
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1527
- if (data.NextToken !== undefined && data.NextToken !== null) {
1501
+ if (data.NextToken != null) {
1528
1502
  contents.NextToken = __expectString(data.NextToken);
1529
1503
  }
1530
- if (data.SamplingStatisticSummaries !== undefined && data.SamplingStatisticSummaries !== null) {
1504
+ if (data.SamplingStatisticSummaries != null) {
1531
1505
  contents.SamplingStatisticSummaries = deserializeAws_restJson1SamplingStatisticSummaryList(data.SamplingStatisticSummaries, context);
1532
1506
  }
1533
- return [2, Promise.resolve(contents)];
1507
+ return [2, contents];
1534
1508
  }
1535
1509
  });
1536
1510
  }); };
1537
1511
  var deserializeAws_restJson1GetSamplingStatisticSummariesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1538
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1512
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1539
1513
  var _c;
1540
1514
  return __generator(this, function (_d) {
1541
1515
  switch (_d.label) {
@@ -1560,14 +1534,14 @@ var deserializeAws_restJson1GetSamplingStatisticSummariesCommandError = function
1560
1534
  case 5: throw _d.sent();
1561
1535
  case 6:
1562
1536
  parsedBody = parsedOutput.body;
1563
- $metadata = deserializeMetadata(output);
1564
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1565
- response = new __BaseException({
1566
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1567
- $fault: "client",
1568
- $metadata: $metadata,
1537
+ throwDefaultError({
1538
+ output: output,
1539
+ parsedBody: parsedBody,
1540
+ exceptionCtor: __BaseException,
1541
+ errorCode: errorCode,
1569
1542
  });
1570
- throw __decorateServiceException(response, parsedBody);
1543
+ _d.label = 7;
1544
+ case 7: return [2];
1571
1545
  }
1572
1546
  });
1573
1547
  }); };
@@ -1579,32 +1553,29 @@ export var deserializeAws_restJson1GetSamplingTargetsCommand = function (output,
1579
1553
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1580
1554
  return [2, deserializeAws_restJson1GetSamplingTargetsCommandError(output, context)];
1581
1555
  }
1582
- contents = {
1556
+ contents = map({
1583
1557
  $metadata: deserializeMetadata(output),
1584
- LastRuleModification: undefined,
1585
- SamplingTargetDocuments: undefined,
1586
- UnprocessedStatistics: undefined,
1587
- };
1558
+ });
1588
1559
  _a = __expectNonNull;
1589
1560
  _b = __expectObject;
1590
1561
  return [4, parseBody(output.body, context)];
1591
1562
  case 1:
1592
1563
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1593
- if (data.LastRuleModification !== undefined && data.LastRuleModification !== null) {
1564
+ if (data.LastRuleModification != null) {
1594
1565
  contents.LastRuleModification = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastRuleModification)));
1595
1566
  }
1596
- if (data.SamplingTargetDocuments !== undefined && data.SamplingTargetDocuments !== null) {
1567
+ if (data.SamplingTargetDocuments != null) {
1597
1568
  contents.SamplingTargetDocuments = deserializeAws_restJson1SamplingTargetDocumentList(data.SamplingTargetDocuments, context);
1598
1569
  }
1599
- if (data.UnprocessedStatistics !== undefined && data.UnprocessedStatistics !== null) {
1570
+ if (data.UnprocessedStatistics != null) {
1600
1571
  contents.UnprocessedStatistics = deserializeAws_restJson1UnprocessedStatisticsList(data.UnprocessedStatistics, context);
1601
1572
  }
1602
- return [2, Promise.resolve(contents)];
1573
+ return [2, contents];
1603
1574
  }
1604
1575
  });
1605
1576
  }); };
1606
1577
  var deserializeAws_restJson1GetSamplingTargetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1607
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1578
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1608
1579
  var _c;
1609
1580
  return __generator(this, function (_d) {
1610
1581
  switch (_d.label) {
@@ -1629,14 +1600,14 @@ var deserializeAws_restJson1GetSamplingTargetsCommandError = function (output, c
1629
1600
  case 5: throw _d.sent();
1630
1601
  case 6:
1631
1602
  parsedBody = parsedOutput.body;
1632
- $metadata = deserializeMetadata(output);
1633
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1634
- response = new __BaseException({
1635
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1636
- $fault: "client",
1637
- $metadata: $metadata,
1603
+ throwDefaultError({
1604
+ output: output,
1605
+ parsedBody: parsedBody,
1606
+ exceptionCtor: __BaseException,
1607
+ errorCode: errorCode,
1638
1608
  });
1639
- throw __decorateServiceException(response, parsedBody);
1609
+ _d.label = 7;
1610
+ case 7: return [2];
1640
1611
  }
1641
1612
  });
1642
1613
  }); };
@@ -1648,40 +1619,35 @@ export var deserializeAws_restJson1GetServiceGraphCommand = function (output, co
1648
1619
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1649
1620
  return [2, deserializeAws_restJson1GetServiceGraphCommandError(output, context)];
1650
1621
  }
1651
- contents = {
1622
+ contents = map({
1652
1623
  $metadata: deserializeMetadata(output),
1653
- ContainsOldGroupVersions: undefined,
1654
- EndTime: undefined,
1655
- NextToken: undefined,
1656
- Services: undefined,
1657
- StartTime: undefined,
1658
- };
1624
+ });
1659
1625
  _a = __expectNonNull;
1660
1626
  _b = __expectObject;
1661
1627
  return [4, parseBody(output.body, context)];
1662
1628
  case 1:
1663
1629
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1664
- if (data.ContainsOldGroupVersions !== undefined && data.ContainsOldGroupVersions !== null) {
1630
+ if (data.ContainsOldGroupVersions != null) {
1665
1631
  contents.ContainsOldGroupVersions = __expectBoolean(data.ContainsOldGroupVersions);
1666
1632
  }
1667
- if (data.EndTime !== undefined && data.EndTime !== null) {
1633
+ if (data.EndTime != null) {
1668
1634
  contents.EndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.EndTime)));
1669
1635
  }
1670
- if (data.NextToken !== undefined && data.NextToken !== null) {
1636
+ if (data.NextToken != null) {
1671
1637
  contents.NextToken = __expectString(data.NextToken);
1672
1638
  }
1673
- if (data.Services !== undefined && data.Services !== null) {
1639
+ if (data.Services != null) {
1674
1640
  contents.Services = deserializeAws_restJson1ServiceList(data.Services, context);
1675
1641
  }
1676
- if (data.StartTime !== undefined && data.StartTime !== null) {
1642
+ if (data.StartTime != null) {
1677
1643
  contents.StartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.StartTime)));
1678
1644
  }
1679
- return [2, Promise.resolve(contents)];
1645
+ return [2, contents];
1680
1646
  }
1681
1647
  });
1682
1648
  }); };
1683
1649
  var deserializeAws_restJson1GetServiceGraphCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1684
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1650
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1685
1651
  var _c;
1686
1652
  return __generator(this, function (_d) {
1687
1653
  switch (_d.label) {
@@ -1706,14 +1672,14 @@ var deserializeAws_restJson1GetServiceGraphCommandError = function (output, cont
1706
1672
  case 5: throw _d.sent();
1707
1673
  case 6:
1708
1674
  parsedBody = parsedOutput.body;
1709
- $metadata = deserializeMetadata(output);
1710
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1711
- response = new __BaseException({
1712
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1713
- $fault: "client",
1714
- $metadata: $metadata,
1675
+ throwDefaultError({
1676
+ output: output,
1677
+ parsedBody: parsedBody,
1678
+ exceptionCtor: __BaseException,
1679
+ errorCode: errorCode,
1715
1680
  });
1716
- throw __decorateServiceException(response, parsedBody);
1681
+ _d.label = 7;
1682
+ case 7: return [2];
1717
1683
  }
1718
1684
  });
1719
1685
  }); };
@@ -1725,32 +1691,29 @@ export var deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = funct
1725
1691
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1726
1692
  return [2, deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommandError(output, context)];
1727
1693
  }
1728
- contents = {
1694
+ contents = map({
1729
1695
  $metadata: deserializeMetadata(output),
1730
- ContainsOldGroupVersions: undefined,
1731
- NextToken: undefined,
1732
- TimeSeriesServiceStatistics: undefined,
1733
- };
1696
+ });
1734
1697
  _a = __expectNonNull;
1735
1698
  _b = __expectObject;
1736
1699
  return [4, parseBody(output.body, context)];
1737
1700
  case 1:
1738
1701
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1739
- if (data.ContainsOldGroupVersions !== undefined && data.ContainsOldGroupVersions !== null) {
1702
+ if (data.ContainsOldGroupVersions != null) {
1740
1703
  contents.ContainsOldGroupVersions = __expectBoolean(data.ContainsOldGroupVersions);
1741
1704
  }
1742
- if (data.NextToken !== undefined && data.NextToken !== null) {
1705
+ if (data.NextToken != null) {
1743
1706
  contents.NextToken = __expectString(data.NextToken);
1744
1707
  }
1745
- if (data.TimeSeriesServiceStatistics !== undefined && data.TimeSeriesServiceStatistics !== null) {
1708
+ if (data.TimeSeriesServiceStatistics != null) {
1746
1709
  contents.TimeSeriesServiceStatistics = deserializeAws_restJson1TimeSeriesServiceStatisticsList(data.TimeSeriesServiceStatistics, context);
1747
1710
  }
1748
- return [2, Promise.resolve(contents)];
1711
+ return [2, contents];
1749
1712
  }
1750
1713
  });
1751
1714
  }); };
1752
1715
  var deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1753
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1716
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1754
1717
  var _c;
1755
1718
  return __generator(this, function (_d) {
1756
1719
  switch (_d.label) {
@@ -1775,14 +1738,14 @@ var deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommandError = functio
1775
1738
  case 5: throw _d.sent();
1776
1739
  case 6:
1777
1740
  parsedBody = parsedOutput.body;
1778
- $metadata = deserializeMetadata(output);
1779
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1780
- response = new __BaseException({
1781
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1782
- $fault: "client",
1783
- $metadata: $metadata,
1741
+ throwDefaultError({
1742
+ output: output,
1743
+ parsedBody: parsedBody,
1744
+ exceptionCtor: __BaseException,
1745
+ errorCode: errorCode,
1784
1746
  });
1785
- throw __decorateServiceException(response, parsedBody);
1747
+ _d.label = 7;
1748
+ case 7: return [2];
1786
1749
  }
1787
1750
  });
1788
1751
  }); };
@@ -1794,28 +1757,26 @@ export var deserializeAws_restJson1GetTraceGraphCommand = function (output, cont
1794
1757
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1795
1758
  return [2, deserializeAws_restJson1GetTraceGraphCommandError(output, context)];
1796
1759
  }
1797
- contents = {
1760
+ contents = map({
1798
1761
  $metadata: deserializeMetadata(output),
1799
- NextToken: undefined,
1800
- Services: undefined,
1801
- };
1762
+ });
1802
1763
  _a = __expectNonNull;
1803
1764
  _b = __expectObject;
1804
1765
  return [4, parseBody(output.body, context)];
1805
1766
  case 1:
1806
1767
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1807
- if (data.NextToken !== undefined && data.NextToken !== null) {
1768
+ if (data.NextToken != null) {
1808
1769
  contents.NextToken = __expectString(data.NextToken);
1809
1770
  }
1810
- if (data.Services !== undefined && data.Services !== null) {
1771
+ if (data.Services != null) {
1811
1772
  contents.Services = deserializeAws_restJson1ServiceList(data.Services, context);
1812
1773
  }
1813
- return [2, Promise.resolve(contents)];
1774
+ return [2, contents];
1814
1775
  }
1815
1776
  });
1816
1777
  }); };
1817
1778
  var deserializeAws_restJson1GetTraceGraphCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1818
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1779
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1819
1780
  var _c;
1820
1781
  return __generator(this, function (_d) {
1821
1782
  switch (_d.label) {
@@ -1840,14 +1801,14 @@ var deserializeAws_restJson1GetTraceGraphCommandError = function (output, contex
1840
1801
  case 5: throw _d.sent();
1841
1802
  case 6:
1842
1803
  parsedBody = parsedOutput.body;
1843
- $metadata = deserializeMetadata(output);
1844
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1845
- response = new __BaseException({
1846
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1847
- $fault: "client",
1848
- $metadata: $metadata,
1804
+ throwDefaultError({
1805
+ output: output,
1806
+ parsedBody: parsedBody,
1807
+ exceptionCtor: __BaseException,
1808
+ errorCode: errorCode,
1849
1809
  });
1850
- throw __decorateServiceException(response, parsedBody);
1810
+ _d.label = 7;
1811
+ case 7: return [2];
1851
1812
  }
1852
1813
  });
1853
1814
  }); };
@@ -1859,36 +1820,32 @@ export var deserializeAws_restJson1GetTraceSummariesCommand = function (output,
1859
1820
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1860
1821
  return [2, deserializeAws_restJson1GetTraceSummariesCommandError(output, context)];
1861
1822
  }
1862
- contents = {
1823
+ contents = map({
1863
1824
  $metadata: deserializeMetadata(output),
1864
- ApproximateTime: undefined,
1865
- NextToken: undefined,
1866
- TraceSummaries: undefined,
1867
- TracesProcessedCount: undefined,
1868
- };
1825
+ });
1869
1826
  _a = __expectNonNull;
1870
1827
  _b = __expectObject;
1871
1828
  return [4, parseBody(output.body, context)];
1872
1829
  case 1:
1873
1830
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1874
- if (data.ApproximateTime !== undefined && data.ApproximateTime !== null) {
1831
+ if (data.ApproximateTime != null) {
1875
1832
  contents.ApproximateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ApproximateTime)));
1876
1833
  }
1877
- if (data.NextToken !== undefined && data.NextToken !== null) {
1834
+ if (data.NextToken != null) {
1878
1835
  contents.NextToken = __expectString(data.NextToken);
1879
1836
  }
1880
- if (data.TraceSummaries !== undefined && data.TraceSummaries !== null) {
1837
+ if (data.TraceSummaries != null) {
1881
1838
  contents.TraceSummaries = deserializeAws_restJson1TraceSummaryList(data.TraceSummaries, context);
1882
1839
  }
1883
- if (data.TracesProcessedCount !== undefined && data.TracesProcessedCount !== null) {
1840
+ if (data.TracesProcessedCount != null) {
1884
1841
  contents.TracesProcessedCount = __expectLong(data.TracesProcessedCount);
1885
1842
  }
1886
- return [2, Promise.resolve(contents)];
1843
+ return [2, contents];
1887
1844
  }
1888
1845
  });
1889
1846
  }); };
1890
1847
  var deserializeAws_restJson1GetTraceSummariesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1891
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1848
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1892
1849
  var _c;
1893
1850
  return __generator(this, function (_d) {
1894
1851
  switch (_d.label) {
@@ -1913,14 +1870,14 @@ var deserializeAws_restJson1GetTraceSummariesCommandError = function (output, co
1913
1870
  case 5: throw _d.sent();
1914
1871
  case 6:
1915
1872
  parsedBody = parsedOutput.body;
1916
- $metadata = deserializeMetadata(output);
1917
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1918
- response = new __BaseException({
1919
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1920
- $fault: "client",
1921
- $metadata: $metadata,
1873
+ throwDefaultError({
1874
+ output: output,
1875
+ parsedBody: parsedBody,
1876
+ exceptionCtor: __BaseException,
1877
+ errorCode: errorCode,
1922
1878
  });
1923
- throw __decorateServiceException(response, parsedBody);
1879
+ _d.label = 7;
1880
+ case 7: return [2];
1924
1881
  }
1925
1882
  });
1926
1883
  }); };
@@ -1932,28 +1889,26 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1932
1889
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1933
1890
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1934
1891
  }
1935
- contents = {
1892
+ contents = map({
1936
1893
  $metadata: deserializeMetadata(output),
1937
- NextToken: undefined,
1938
- Tags: undefined,
1939
- };
1894
+ });
1940
1895
  _a = __expectNonNull;
1941
1896
  _b = __expectObject;
1942
1897
  return [4, parseBody(output.body, context)];
1943
1898
  case 1:
1944
1899
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1945
- if (data.NextToken !== undefined && data.NextToken !== null) {
1900
+ if (data.NextToken != null) {
1946
1901
  contents.NextToken = __expectString(data.NextToken);
1947
1902
  }
1948
- if (data.Tags !== undefined && data.Tags !== null) {
1903
+ if (data.Tags != null) {
1949
1904
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
1950
1905
  }
1951
- return [2, Promise.resolve(contents)];
1906
+ return [2, contents];
1952
1907
  }
1953
1908
  });
1954
1909
  }); };
1955
1910
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1956
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1911
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1957
1912
  var _c;
1958
1913
  return __generator(this, function (_d) {
1959
1914
  switch (_d.label) {
@@ -1982,14 +1937,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1982
1937
  case 7: throw _d.sent();
1983
1938
  case 8:
1984
1939
  parsedBody = parsedOutput.body;
1985
- $metadata = deserializeMetadata(output);
1986
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1987
- response = new __BaseException({
1988
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1989
- $fault: "client",
1990
- $metadata: $metadata,
1940
+ throwDefaultError({
1941
+ output: output,
1942
+ parsedBody: parsedBody,
1943
+ exceptionCtor: __BaseException,
1944
+ errorCode: errorCode,
1991
1945
  });
1992
- throw __decorateServiceException(response, parsedBody);
1946
+ _d.label = 9;
1947
+ case 9: return [2];
1993
1948
  }
1994
1949
  });
1995
1950
  }); };
@@ -2001,24 +1956,23 @@ export var deserializeAws_restJson1PutEncryptionConfigCommand = function (output
2001
1956
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2002
1957
  return [2, deserializeAws_restJson1PutEncryptionConfigCommandError(output, context)];
2003
1958
  }
2004
- contents = {
1959
+ contents = map({
2005
1960
  $metadata: deserializeMetadata(output),
2006
- EncryptionConfig: undefined,
2007
- };
1961
+ });
2008
1962
  _a = __expectNonNull;
2009
1963
  _b = __expectObject;
2010
1964
  return [4, parseBody(output.body, context)];
2011
1965
  case 1:
2012
1966
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2013
- if (data.EncryptionConfig !== undefined && data.EncryptionConfig !== null) {
1967
+ if (data.EncryptionConfig != null) {
2014
1968
  contents.EncryptionConfig = deserializeAws_restJson1EncryptionConfig(data.EncryptionConfig, context);
2015
1969
  }
2016
- return [2, Promise.resolve(contents)];
1970
+ return [2, contents];
2017
1971
  }
2018
1972
  });
2019
1973
  }); };
2020
1974
  var deserializeAws_restJson1PutEncryptionConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2021
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1975
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2022
1976
  var _c;
2023
1977
  return __generator(this, function (_d) {
2024
1978
  switch (_d.label) {
@@ -2043,14 +1997,14 @@ var deserializeAws_restJson1PutEncryptionConfigCommandError = function (output,
2043
1997
  case 5: throw _d.sent();
2044
1998
  case 6:
2045
1999
  parsedBody = parsedOutput.body;
2046
- $metadata = deserializeMetadata(output);
2047
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2048
- response = new __BaseException({
2049
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2050
- $fault: "client",
2051
- $metadata: $metadata,
2000
+ throwDefaultError({
2001
+ output: output,
2002
+ parsedBody: parsedBody,
2003
+ exceptionCtor: __BaseException,
2004
+ errorCode: errorCode,
2052
2005
  });
2053
- throw __decorateServiceException(response, parsedBody);
2006
+ _d.label = 7;
2007
+ case 7: return [2];
2054
2008
  }
2055
2009
  });
2056
2010
  }); };
@@ -2062,18 +2016,18 @@ export var deserializeAws_restJson1PutTelemetryRecordsCommand = function (output
2062
2016
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2063
2017
  return [2, deserializeAws_restJson1PutTelemetryRecordsCommandError(output, context)];
2064
2018
  }
2065
- contents = {
2019
+ contents = map({
2066
2020
  $metadata: deserializeMetadata(output),
2067
- };
2021
+ });
2068
2022
  return [4, collectBody(output.body, context)];
2069
2023
  case 1:
2070
2024
  _a.sent();
2071
- return [2, Promise.resolve(contents)];
2025
+ return [2, contents];
2072
2026
  }
2073
2027
  });
2074
2028
  }); };
2075
2029
  var deserializeAws_restJson1PutTelemetryRecordsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2076
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2030
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2077
2031
  var _c;
2078
2032
  return __generator(this, function (_d) {
2079
2033
  switch (_d.label) {
@@ -2098,14 +2052,14 @@ var deserializeAws_restJson1PutTelemetryRecordsCommandError = function (output,
2098
2052
  case 5: throw _d.sent();
2099
2053
  case 6:
2100
2054
  parsedBody = parsedOutput.body;
2101
- $metadata = deserializeMetadata(output);
2102
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2103
- response = new __BaseException({
2104
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2105
- $fault: "client",
2106
- $metadata: $metadata,
2055
+ throwDefaultError({
2056
+ output: output,
2057
+ parsedBody: parsedBody,
2058
+ exceptionCtor: __BaseException,
2059
+ errorCode: errorCode,
2107
2060
  });
2108
- throw __decorateServiceException(response, parsedBody);
2061
+ _d.label = 7;
2062
+ case 7: return [2];
2109
2063
  }
2110
2064
  });
2111
2065
  }); };
@@ -2117,24 +2071,23 @@ export var deserializeAws_restJson1PutTraceSegmentsCommand = function (output, c
2117
2071
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2118
2072
  return [2, deserializeAws_restJson1PutTraceSegmentsCommandError(output, context)];
2119
2073
  }
2120
- contents = {
2074
+ contents = map({
2121
2075
  $metadata: deserializeMetadata(output),
2122
- UnprocessedTraceSegments: undefined,
2123
- };
2076
+ });
2124
2077
  _a = __expectNonNull;
2125
2078
  _b = __expectObject;
2126
2079
  return [4, parseBody(output.body, context)];
2127
2080
  case 1:
2128
2081
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2129
- if (data.UnprocessedTraceSegments !== undefined && data.UnprocessedTraceSegments !== null) {
2082
+ if (data.UnprocessedTraceSegments != null) {
2130
2083
  contents.UnprocessedTraceSegments = deserializeAws_restJson1UnprocessedTraceSegmentList(data.UnprocessedTraceSegments, context);
2131
2084
  }
2132
- return [2, Promise.resolve(contents)];
2085
+ return [2, contents];
2133
2086
  }
2134
2087
  });
2135
2088
  }); };
2136
2089
  var deserializeAws_restJson1PutTraceSegmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2137
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2090
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2138
2091
  var _c;
2139
2092
  return __generator(this, function (_d) {
2140
2093
  switch (_d.label) {
@@ -2159,14 +2112,14 @@ var deserializeAws_restJson1PutTraceSegmentsCommandError = function (output, con
2159
2112
  case 5: throw _d.sent();
2160
2113
  case 6:
2161
2114
  parsedBody = parsedOutput.body;
2162
- $metadata = deserializeMetadata(output);
2163
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2164
- response = new __BaseException({
2165
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2166
- $fault: "client",
2167
- $metadata: $metadata,
2115
+ throwDefaultError({
2116
+ output: output,
2117
+ parsedBody: parsedBody,
2118
+ exceptionCtor: __BaseException,
2119
+ errorCode: errorCode,
2168
2120
  });
2169
- throw __decorateServiceException(response, parsedBody);
2121
+ _d.label = 7;
2122
+ case 7: return [2];
2170
2123
  }
2171
2124
  });
2172
2125
  }); };
@@ -2178,18 +2131,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2178
2131
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2179
2132
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2180
2133
  }
2181
- contents = {
2134
+ contents = map({
2182
2135
  $metadata: deserializeMetadata(output),
2183
- };
2136
+ });
2184
2137
  return [4, collectBody(output.body, context)];
2185
2138
  case 1:
2186
2139
  _a.sent();
2187
- return [2, Promise.resolve(contents)];
2140
+ return [2, contents];
2188
2141
  }
2189
2142
  });
2190
2143
  }); };
2191
2144
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2192
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2145
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2193
2146
  var _c;
2194
2147
  return __generator(this, function (_d) {
2195
2148
  switch (_d.label) {
@@ -2222,14 +2175,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2222
2175
  case 9: throw _d.sent();
2223
2176
  case 10:
2224
2177
  parsedBody = parsedOutput.body;
2225
- $metadata = deserializeMetadata(output);
2226
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2227
- response = new __BaseException({
2228
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2229
- $fault: "client",
2230
- $metadata: $metadata,
2178
+ throwDefaultError({
2179
+ output: output,
2180
+ parsedBody: parsedBody,
2181
+ exceptionCtor: __BaseException,
2182
+ errorCode: errorCode,
2231
2183
  });
2232
- throw __decorateServiceException(response, parsedBody);
2184
+ _d.label = 11;
2185
+ case 11: return [2];
2233
2186
  }
2234
2187
  });
2235
2188
  }); };
@@ -2241,18 +2194,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2241
2194
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2242
2195
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2243
2196
  }
2244
- contents = {
2197
+ contents = map({
2245
2198
  $metadata: deserializeMetadata(output),
2246
- };
2199
+ });
2247
2200
  return [4, collectBody(output.body, context)];
2248
2201
  case 1:
2249
2202
  _a.sent();
2250
- return [2, Promise.resolve(contents)];
2203
+ return [2, contents];
2251
2204
  }
2252
2205
  });
2253
2206
  }); };
2254
2207
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2255
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2208
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2256
2209
  var _c;
2257
2210
  return __generator(this, function (_d) {
2258
2211
  switch (_d.label) {
@@ -2281,14 +2234,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2281
2234
  case 7: throw _d.sent();
2282
2235
  case 8:
2283
2236
  parsedBody = parsedOutput.body;
2284
- $metadata = deserializeMetadata(output);
2285
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2286
- response = new __BaseException({
2287
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2288
- $fault: "client",
2289
- $metadata: $metadata,
2237
+ throwDefaultError({
2238
+ output: output,
2239
+ parsedBody: parsedBody,
2240
+ exceptionCtor: __BaseException,
2241
+ errorCode: errorCode,
2290
2242
  });
2291
- throw __decorateServiceException(response, parsedBody);
2243
+ _d.label = 9;
2244
+ case 9: return [2];
2292
2245
  }
2293
2246
  });
2294
2247
  }); };
@@ -2300,24 +2253,23 @@ export var deserializeAws_restJson1UpdateGroupCommand = function (output, contex
2300
2253
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2301
2254
  return [2, deserializeAws_restJson1UpdateGroupCommandError(output, context)];
2302
2255
  }
2303
- contents = {
2256
+ contents = map({
2304
2257
  $metadata: deserializeMetadata(output),
2305
- Group: undefined,
2306
- };
2258
+ });
2307
2259
  _a = __expectNonNull;
2308
2260
  _b = __expectObject;
2309
2261
  return [4, parseBody(output.body, context)];
2310
2262
  case 1:
2311
2263
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2312
- if (data.Group !== undefined && data.Group !== null) {
2264
+ if (data.Group != null) {
2313
2265
  contents.Group = deserializeAws_restJson1Group(data.Group, context);
2314
2266
  }
2315
- return [2, Promise.resolve(contents)];
2267
+ return [2, contents];
2316
2268
  }
2317
2269
  });
2318
2270
  }); };
2319
2271
  var deserializeAws_restJson1UpdateGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2320
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2272
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2321
2273
  var _c;
2322
2274
  return __generator(this, function (_d) {
2323
2275
  switch (_d.label) {
@@ -2342,14 +2294,14 @@ var deserializeAws_restJson1UpdateGroupCommandError = function (output, context)
2342
2294
  case 5: throw _d.sent();
2343
2295
  case 6:
2344
2296
  parsedBody = parsedOutput.body;
2345
- $metadata = deserializeMetadata(output);
2346
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2347
- response = new __BaseException({
2348
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2349
- $fault: "client",
2350
- $metadata: $metadata,
2297
+ throwDefaultError({
2298
+ output: output,
2299
+ parsedBody: parsedBody,
2300
+ exceptionCtor: __BaseException,
2301
+ errorCode: errorCode,
2351
2302
  });
2352
- throw __decorateServiceException(response, parsedBody);
2303
+ _d.label = 7;
2304
+ case 7: return [2];
2353
2305
  }
2354
2306
  });
2355
2307
  }); };
@@ -2361,24 +2313,23 @@ export var deserializeAws_restJson1UpdateSamplingRuleCommand = function (output,
2361
2313
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2362
2314
  return [2, deserializeAws_restJson1UpdateSamplingRuleCommandError(output, context)];
2363
2315
  }
2364
- contents = {
2316
+ contents = map({
2365
2317
  $metadata: deserializeMetadata(output),
2366
- SamplingRuleRecord: undefined,
2367
- };
2318
+ });
2368
2319
  _a = __expectNonNull;
2369
2320
  _b = __expectObject;
2370
2321
  return [4, parseBody(output.body, context)];
2371
2322
  case 1:
2372
2323
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2373
- if (data.SamplingRuleRecord !== undefined && data.SamplingRuleRecord !== null) {
2324
+ if (data.SamplingRuleRecord != null) {
2374
2325
  contents.SamplingRuleRecord = deserializeAws_restJson1SamplingRuleRecord(data.SamplingRuleRecord, context);
2375
2326
  }
2376
- return [2, Promise.resolve(contents)];
2327
+ return [2, contents];
2377
2328
  }
2378
2329
  });
2379
2330
  }); };
2380
2331
  var deserializeAws_restJson1UpdateSamplingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2381
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2332
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2382
2333
  var _c;
2383
2334
  return __generator(this, function (_d) {
2384
2335
  switch (_d.label) {
@@ -2403,23 +2354,24 @@ var deserializeAws_restJson1UpdateSamplingRuleCommandError = function (output, c
2403
2354
  case 5: throw _d.sent();
2404
2355
  case 6:
2405
2356
  parsedBody = parsedOutput.body;
2406
- $metadata = deserializeMetadata(output);
2407
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2408
- response = new __BaseException({
2409
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2410
- $fault: "client",
2411
- $metadata: $metadata,
2357
+ throwDefaultError({
2358
+ output: output,
2359
+ parsedBody: parsedBody,
2360
+ exceptionCtor: __BaseException,
2361
+ errorCode: errorCode,
2412
2362
  });
2413
- throw __decorateServiceException(response, parsedBody);
2363
+ _d.label = 7;
2364
+ case 7: return [2];
2414
2365
  }
2415
2366
  });
2416
2367
  }); };
2368
+ var map = __map;
2417
2369
  var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2418
2370
  var contents, data, exception;
2419
2371
  return __generator(this, function (_a) {
2420
- contents = {};
2372
+ contents = map({});
2421
2373
  data = parsedOutput.body;
2422
- if (data.Message !== undefined && data.Message !== null) {
2374
+ if (data.Message != null) {
2423
2375
  contents.Message = __expectString(data.Message);
2424
2376
  }
2425
2377
  exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2429,12 +2381,12 @@ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOu
2429
2381
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2430
2382
  var contents, data, exception;
2431
2383
  return __generator(this, function (_a) {
2432
- contents = {};
2384
+ contents = map({});
2433
2385
  data = parsedOutput.body;
2434
- if (data.Message !== undefined && data.Message !== null) {
2386
+ if (data.Message != null) {
2435
2387
  contents.Message = __expectString(data.Message);
2436
2388
  }
2437
- if (data.ResourceName !== undefined && data.ResourceName !== null) {
2389
+ if (data.ResourceName != null) {
2438
2390
  contents.ResourceName = __expectString(data.ResourceName);
2439
2391
  }
2440
2392
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2444,9 +2396,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
2444
2396
  var deserializeAws_restJson1RuleLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2445
2397
  var contents, data, exception;
2446
2398
  return __generator(this, function (_a) {
2447
- contents = {};
2399
+ contents = map({});
2448
2400
  data = parsedOutput.body;
2449
- if (data.Message !== undefined && data.Message !== null) {
2401
+ if (data.Message != null) {
2450
2402
  contents.Message = __expectString(data.Message);
2451
2403
  }
2452
2404
  exception = new RuleLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2456,9 +2408,9 @@ var deserializeAws_restJson1RuleLimitExceededExceptionResponse = function (parse
2456
2408
  var deserializeAws_restJson1ThrottledExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2457
2409
  var contents, data, exception;
2458
2410
  return __generator(this, function (_a) {
2459
- contents = {};
2411
+ contents = map({});
2460
2412
  data = parsedOutput.body;
2461
- if (data.Message !== undefined && data.Message !== null) {
2413
+ if (data.Message != null) {
2462
2414
  contents.Message = __expectString(data.Message);
2463
2415
  }
2464
2416
  exception = new ThrottledException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2468,12 +2420,12 @@ var deserializeAws_restJson1ThrottledExceptionResponse = function (parsedOutput,
2468
2420
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2469
2421
  var contents, data, exception;
2470
2422
  return __generator(this, function (_a) {
2471
- contents = {};
2423
+ contents = map({});
2472
2424
  data = parsedOutput.body;
2473
- if (data.Message !== undefined && data.Message !== null) {
2425
+ if (data.Message != null) {
2474
2426
  contents.Message = __expectString(data.Message);
2475
2427
  }
2476
- if (data.ResourceName !== undefined && data.ResourceName !== null) {
2428
+ if (data.ResourceName != null) {
2477
2429
  contents.ResourceName = __expectString(data.ResourceName);
2478
2430
  }
2479
2431
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2500,9 +2452,6 @@ var serializeAws_restJson1InsightStateList = function (input, context) {
2500
2452
  return input
2501
2453
  .filter(function (e) { return e != null; })
2502
2454
  .map(function (entry) {
2503
- if (entry === null) {
2504
- return null;
2505
- }
2506
2455
  return entry;
2507
2456
  });
2508
2457
  };
@@ -2519,9 +2468,6 @@ var serializeAws_restJson1SamplingStatisticsDocumentList = function (input, cont
2519
2468
  return input
2520
2469
  .filter(function (e) { return e != null; })
2521
2470
  .map(function (entry) {
2522
- if (entry === null) {
2523
- return null;
2524
- }
2525
2471
  return serializeAws_restJson1SamplingStatisticsDocument(entry, context);
2526
2472
  });
2527
2473
  };
@@ -2535,9 +2481,6 @@ var serializeAws_restJson1TagKeyList = function (input, context) {
2535
2481
  return input
2536
2482
  .filter(function (e) { return e != null; })
2537
2483
  .map(function (entry) {
2538
- if (entry === null) {
2539
- return null;
2540
- }
2541
2484
  return entry;
2542
2485
  });
2543
2486
  };
@@ -2545,9 +2488,6 @@ var serializeAws_restJson1TagList = function (input, context) {
2545
2488
  return input
2546
2489
  .filter(function (e) { return e != null; })
2547
2490
  .map(function (entry) {
2548
- if (entry === null) {
2549
- return null;
2550
- }
2551
2491
  return serializeAws_restJson1Tag(entry, context);
2552
2492
  });
2553
2493
  };
@@ -2560,9 +2500,6 @@ var serializeAws_restJson1TelemetryRecordList = function (input, context) {
2560
2500
  return input
2561
2501
  .filter(function (e) { return e != null; })
2562
2502
  .map(function (entry) {
2563
- if (entry === null) {
2564
- return null;
2565
- }
2566
2503
  return serializeAws_restJson1TelemetryRecord(entry, context);
2567
2504
  });
2568
2505
  };
@@ -2570,9 +2507,6 @@ var serializeAws_restJson1TraceIdList = function (input, context) {
2570
2507
  return input
2571
2508
  .filter(function (e) { return e != null; })
2572
2509
  .map(function (entry) {
2573
- if (entry === null) {
2574
- return null;
2575
- }
2576
2510
  return entry;
2577
2511
  });
2578
2512
  };
@@ -2580,9 +2514,6 @@ var serializeAws_restJson1TraceSegmentDocumentList = function (input, context) {
2580
2514
  return input
2581
2515
  .filter(function (e) { return e != null; })
2582
2516
  .map(function (entry) {
2583
- if (entry === null) {
2584
- return null;
2585
- }
2586
2517
  return entry;
2587
2518
  });
2588
2519
  };