@aws-sdk/client-billingconductor 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 (69) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/AssociateAccountsCommand.js +2 -2
  4. package/dist-cjs/commands/AssociatePricingRulesCommand.js +2 -2
  5. package/dist-cjs/commands/BatchAssociateResourcesToCustomLineItemCommand.js +2 -2
  6. package/dist-cjs/commands/BatchDisassociateResourcesFromCustomLineItemCommand.js +2 -2
  7. package/dist-cjs/commands/CreateBillingGroupCommand.js +2 -2
  8. package/dist-cjs/commands/CreateCustomLineItemCommand.js +2 -2
  9. package/dist-cjs/commands/CreatePricingPlanCommand.js +2 -2
  10. package/dist-cjs/commands/CreatePricingRuleCommand.js +2 -2
  11. package/dist-cjs/commands/DeleteBillingGroupCommand.js +2 -2
  12. package/dist-cjs/commands/DeleteCustomLineItemCommand.js +2 -2
  13. package/dist-cjs/commands/DeletePricingPlanCommand.js +2 -2
  14. package/dist-cjs/commands/DeletePricingRuleCommand.js +2 -2
  15. package/dist-cjs/commands/DisassociateAccountsCommand.js +2 -2
  16. package/dist-cjs/commands/DisassociatePricingRulesCommand.js +2 -2
  17. package/dist-cjs/commands/ListAccountAssociationsCommand.js +2 -2
  18. package/dist-cjs/commands/ListBillingGroupCostReportsCommand.js +2 -2
  19. package/dist-cjs/commands/ListBillingGroupsCommand.js +2 -2
  20. package/dist-cjs/commands/ListCustomLineItemsCommand.js +2 -2
  21. package/dist-cjs/commands/ListPricingPlansAssociatedWithPricingRuleCommand.js +2 -2
  22. package/dist-cjs/commands/ListPricingPlansCommand.js +2 -2
  23. package/dist-cjs/commands/ListPricingRulesAssociatedToPricingPlanCommand.js +2 -2
  24. package/dist-cjs/commands/ListPricingRulesCommand.js +2 -2
  25. package/dist-cjs/commands/ListResourcesAssociatedToCustomLineItemCommand.js +2 -2
  26. package/dist-cjs/commands/ListTagsForResourceCommand.js +2 -2
  27. package/dist-cjs/commands/TagResourceCommand.js +2 -2
  28. package/dist-cjs/commands/UntagResourceCommand.js +2 -2
  29. package/dist-cjs/commands/UpdateBillingGroupCommand.js +2 -2
  30. package/dist-cjs/commands/UpdateCustomLineItemCommand.js +2 -2
  31. package/dist-cjs/commands/UpdatePricingPlanCommand.js +2 -2
  32. package/dist-cjs/commands/UpdatePricingRuleCommand.js +2 -2
  33. package/dist-cjs/models/models_0.js +414 -594
  34. package/dist-cjs/protocols/Aws_restJson1.js +365 -582
  35. package/dist-es/commands/AssociateAccountsCommand.js +3 -3
  36. package/dist-es/commands/AssociatePricingRulesCommand.js +3 -3
  37. package/dist-es/commands/BatchAssociateResourcesToCustomLineItemCommand.js +3 -3
  38. package/dist-es/commands/BatchDisassociateResourcesFromCustomLineItemCommand.js +3 -3
  39. package/dist-es/commands/CreateBillingGroupCommand.js +3 -3
  40. package/dist-es/commands/CreateCustomLineItemCommand.js +3 -3
  41. package/dist-es/commands/CreatePricingPlanCommand.js +3 -3
  42. package/dist-es/commands/CreatePricingRuleCommand.js +3 -3
  43. package/dist-es/commands/DeleteBillingGroupCommand.js +3 -3
  44. package/dist-es/commands/DeleteCustomLineItemCommand.js +3 -3
  45. package/dist-es/commands/DeletePricingPlanCommand.js +3 -3
  46. package/dist-es/commands/DeletePricingRuleCommand.js +3 -3
  47. package/dist-es/commands/DisassociateAccountsCommand.js +3 -3
  48. package/dist-es/commands/DisassociatePricingRulesCommand.js +3 -3
  49. package/dist-es/commands/ListAccountAssociationsCommand.js +3 -3
  50. package/dist-es/commands/ListBillingGroupCostReportsCommand.js +3 -3
  51. package/dist-es/commands/ListBillingGroupsCommand.js +3 -3
  52. package/dist-es/commands/ListCustomLineItemsCommand.js +3 -3
  53. package/dist-es/commands/ListPricingPlansAssociatedWithPricingRuleCommand.js +3 -3
  54. package/dist-es/commands/ListPricingPlansCommand.js +3 -3
  55. package/dist-es/commands/ListPricingRulesAssociatedToPricingPlanCommand.js +3 -3
  56. package/dist-es/commands/ListPricingRulesCommand.js +3 -3
  57. package/dist-es/commands/ListResourcesAssociatedToCustomLineItemCommand.js +3 -3
  58. package/dist-es/commands/ListTagsForResourceCommand.js +3 -3
  59. package/dist-es/commands/TagResourceCommand.js +3 -3
  60. package/dist-es/commands/UntagResourceCommand.js +3 -3
  61. package/dist-es/commands/UpdateBillingGroupCommand.js +3 -3
  62. package/dist-es/commands/UpdateCustomLineItemCommand.js +3 -3
  63. package/dist-es/commands/UpdatePricingPlanCommand.js +3 -3
  64. package/dist-es/commands/UpdatePricingRuleCommand.js +3 -3
  65. package/dist-es/models/models_0.js +100 -370
  66. package/dist-es/protocols/Aws_restJson1.js +463 -576
  67. package/dist-types/models/models_0.d.ts +360 -540
  68. package/dist-types/ts3.4/models/models_0.d.ts +180 -360
  69. 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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { BillingconductorServiceException as __BaseException } from "../models/BillingconductorServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1AssociateAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -118,7 +118,10 @@ export var serializeAws_restJson1CreateBillingGroupCommand = function (input, co
118
118
  case 0: return [4, context.endpoint()];
119
119
  case 1:
120
120
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
121
- headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
121
+ headers = map({}, isSerializableHeaderValue, {
122
+ "content-type": "application/json",
123
+ "x-amzn-client-token": input.ClientToken,
124
+ });
122
125
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-billing-group";
123
126
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AccountGrouping != null && {
124
127
  AccountGrouping: serializeAws_restJson1AccountGrouping(input.AccountGrouping, context),
@@ -144,7 +147,10 @@ export var serializeAws_restJson1CreateCustomLineItemCommand = function (input,
144
147
  case 0: return [4, context.endpoint()];
145
148
  case 1:
146
149
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
147
- headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
150
+ headers = map({}, isSerializableHeaderValue, {
151
+ "content-type": "application/json",
152
+ "x-amzn-client-token": input.ClientToken,
153
+ });
148
154
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-custom-line-item";
149
155
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.BillingGroupArn != null && { BillingGroupArn: input.BillingGroupArn })), (input.BillingPeriodRange != null && {
150
156
  BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
@@ -170,7 +176,10 @@ export var serializeAws_restJson1CreatePricingPlanCommand = function (input, con
170
176
  case 0: return [4, context.endpoint()];
171
177
  case 1:
172
178
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
173
- headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
179
+ headers = map({}, isSerializableHeaderValue, {
180
+ "content-type": "application/json",
181
+ "x-amzn-client-token": input.ClientToken,
182
+ });
174
183
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-pricing-plan";
175
184
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.PricingRuleArns != null && {
176
185
  PricingRuleArns: serializeAws_restJson1PricingRuleArnsInput(input.PricingRuleArns, context),
@@ -194,7 +203,10 @@ export var serializeAws_restJson1CreatePricingRuleCommand = function (input, con
194
203
  case 0: return [4, context.endpoint()];
195
204
  case 1:
196
205
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
197
- headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
206
+ headers = map({}, isSerializableHeaderValue, {
207
+ "content-type": "application/json",
208
+ "x-amzn-client-token": input.ClientToken,
209
+ });
198
210
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-pricing-rule";
199
211
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.ModifierPercentage != null && { ModifierPercentage: __serializeFloat(input.ModifierPercentage) })), (input.Name != null && { Name: input.Name })), (input.Scope != null && { Scope: input.Scope })), (input.Service != null && { Service: input.Service })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.Type != null && { Type: input.Type })));
200
212
  return [2, new __HttpRequest({
@@ -583,7 +595,7 @@ export var serializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommand
583
595
  });
584
596
  }); };
585
597
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
586
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
598
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
587
599
  return __generator(this, function (_c) {
588
600
  switch (_c.label) {
589
601
  case 0: return [4, context.endpoint()];
@@ -591,16 +603,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
591
603
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
592
604
  headers = {};
593
605
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
594
- if (input.ResourceArn !== undefined) {
595
- labelValue = input.ResourceArn;
596
- if (labelValue.length <= 0) {
597
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
598
- }
599
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
600
- }
601
- else {
602
- throw new Error("No value provided for input HTTP label: ResourceArn.");
603
- }
606
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
604
607
  return [2, new __HttpRequest({
605
608
  protocol: protocol,
606
609
  hostname: hostname,
@@ -614,7 +617,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
614
617
  });
615
618
  }); };
616
619
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
617
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
620
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
618
621
  return __generator(this, function (_c) {
619
622
  switch (_c.label) {
620
623
  case 0: return [4, context.endpoint()];
@@ -624,16 +627,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
624
627
  "content-type": "application/json",
625
628
  };
626
629
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
627
- if (input.ResourceArn !== undefined) {
628
- labelValue = input.ResourceArn;
629
- if (labelValue.length <= 0) {
630
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
631
- }
632
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
633
- }
634
- else {
635
- throw new Error("No value provided for input HTTP label: ResourceArn.");
636
- }
630
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
637
631
  body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
638
632
  return [2, new __HttpRequest({
639
633
  protocol: protocol,
@@ -648,7 +642,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
648
642
  });
649
643
  }); };
650
644
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
651
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
645
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
652
646
  return __generator(this, function (_c) {
653
647
  switch (_c.label) {
654
648
  case 0: return [4, context.endpoint()];
@@ -656,17 +650,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
656
650
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
657
651
  headers = {};
658
652
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
659
- if (input.ResourceArn !== undefined) {
660
- labelValue = input.ResourceArn;
661
- if (labelValue.length <= 0) {
662
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
663
- }
664
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
665
- }
666
- else {
667
- throw new Error("No value provided for input HTTP label: ResourceArn.");
668
- }
669
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
653
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
654
+ query = map({
655
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
656
+ });
670
657
  return [2, new __HttpRequest({
671
658
  protocol: protocol,
672
659
  hostname: hostname,
@@ -790,24 +777,23 @@ export var deserializeAws_restJson1AssociateAccountsCommand = function (output,
790
777
  if (output.statusCode !== 200 && output.statusCode >= 300) {
791
778
  return [2, deserializeAws_restJson1AssociateAccountsCommandError(output, context)];
792
779
  }
793
- contents = {
780
+ contents = map({
794
781
  $metadata: deserializeMetadata(output),
795
- Arn: undefined,
796
- };
782
+ });
797
783
  _a = __expectNonNull;
798
784
  _b = __expectObject;
799
785
  return [4, parseBody(output.body, context)];
800
786
  case 1:
801
787
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
802
- if (data.Arn !== undefined && data.Arn !== null) {
788
+ if (data.Arn != null) {
803
789
  contents.Arn = __expectString(data.Arn);
804
790
  }
805
- return [2, Promise.resolve(contents)];
791
+ return [2, contents];
806
792
  }
807
793
  });
808
794
  }); };
809
795
  var deserializeAws_restJson1AssociateAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
810
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
796
+ var parsedOutput, _a, errorCode, _b, parsedBody;
811
797
  var _c;
812
798
  return __generator(this, function (_d) {
813
799
  switch (_d.label) {
@@ -852,14 +838,14 @@ var deserializeAws_restJson1AssociateAccountsCommandError = function (output, co
852
838
  case 15: throw _d.sent();
853
839
  case 16:
854
840
  parsedBody = parsedOutput.body;
855
- $metadata = deserializeMetadata(output);
856
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
857
- response = new __BaseException({
858
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
859
- $fault: "client",
860
- $metadata: $metadata,
841
+ throwDefaultError({
842
+ output: output,
843
+ parsedBody: parsedBody,
844
+ exceptionCtor: __BaseException,
845
+ errorCode: errorCode,
861
846
  });
862
- throw __decorateServiceException(response, parsedBody);
847
+ _d.label = 17;
848
+ case 17: return [2];
863
849
  }
864
850
  });
865
851
  }); };
@@ -871,24 +857,23 @@ export var deserializeAws_restJson1AssociatePricingRulesCommand = function (outp
871
857
  if (output.statusCode !== 200 && output.statusCode >= 300) {
872
858
  return [2, deserializeAws_restJson1AssociatePricingRulesCommandError(output, context)];
873
859
  }
874
- contents = {
860
+ contents = map({
875
861
  $metadata: deserializeMetadata(output),
876
- Arn: undefined,
877
- };
862
+ });
878
863
  _a = __expectNonNull;
879
864
  _b = __expectObject;
880
865
  return [4, parseBody(output.body, context)];
881
866
  case 1:
882
867
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
883
- if (data.Arn !== undefined && data.Arn !== null) {
868
+ if (data.Arn != null) {
884
869
  contents.Arn = __expectString(data.Arn);
885
870
  }
886
- return [2, Promise.resolve(contents)];
871
+ return [2, contents];
887
872
  }
888
873
  });
889
874
  }); };
890
875
  var deserializeAws_restJson1AssociatePricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
891
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
876
+ var parsedOutput, _a, errorCode, _b, parsedBody;
892
877
  var _c;
893
878
  return __generator(this, function (_d) {
894
879
  switch (_d.label) {
@@ -933,14 +918,14 @@ var deserializeAws_restJson1AssociatePricingRulesCommandError = function (output
933
918
  case 15: throw _d.sent();
934
919
  case 16:
935
920
  parsedBody = parsedOutput.body;
936
- $metadata = deserializeMetadata(output);
937
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
938
- response = new __BaseException({
939
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
940
- $fault: "client",
941
- $metadata: $metadata,
921
+ throwDefaultError({
922
+ output: output,
923
+ parsedBody: parsedBody,
924
+ exceptionCtor: __BaseException,
925
+ errorCode: errorCode,
942
926
  });
943
- throw __decorateServiceException(response, parsedBody);
927
+ _d.label = 17;
928
+ case 17: return [2];
944
929
  }
945
930
  });
946
931
  }); };
@@ -952,28 +937,26 @@ export var deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemComman
952
937
  if (output.statusCode !== 200 && output.statusCode >= 300) {
953
938
  return [2, deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError(output, context)];
954
939
  }
955
- contents = {
940
+ contents = map({
956
941
  $metadata: deserializeMetadata(output),
957
- FailedAssociatedResources: undefined,
958
- SuccessfullyAssociatedResources: undefined,
959
- };
942
+ });
960
943
  _a = __expectNonNull;
961
944
  _b = __expectObject;
962
945
  return [4, parseBody(output.body, context)];
963
946
  case 1:
964
947
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
965
- if (data.FailedAssociatedResources !== undefined && data.FailedAssociatedResources !== null) {
948
+ if (data.FailedAssociatedResources != null) {
966
949
  contents.FailedAssociatedResources = deserializeAws_restJson1AssociateResourcesResponseList(data.FailedAssociatedResources, context);
967
950
  }
968
- if (data.SuccessfullyAssociatedResources !== undefined && data.SuccessfullyAssociatedResources !== null) {
951
+ if (data.SuccessfullyAssociatedResources != null) {
969
952
  contents.SuccessfullyAssociatedResources = deserializeAws_restJson1AssociateResourcesResponseList(data.SuccessfullyAssociatedResources, context);
970
953
  }
971
- return [2, Promise.resolve(contents)];
954
+ return [2, contents];
972
955
  }
973
956
  });
974
957
  }); };
975
958
  var deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
976
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
959
+ var parsedOutput, _a, errorCode, _b, parsedBody;
977
960
  var _c;
978
961
  return __generator(this, function (_d) {
979
962
  switch (_d.label) {
@@ -1018,14 +1001,14 @@ var deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError
1018
1001
  case 15: throw _d.sent();
1019
1002
  case 16:
1020
1003
  parsedBody = parsedOutput.body;
1021
- $metadata = deserializeMetadata(output);
1022
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1023
- response = new __BaseException({
1024
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1025
- $fault: "client",
1026
- $metadata: $metadata,
1004
+ throwDefaultError({
1005
+ output: output,
1006
+ parsedBody: parsedBody,
1007
+ exceptionCtor: __BaseException,
1008
+ errorCode: errorCode,
1027
1009
  });
1028
- throw __decorateServiceException(response, parsedBody);
1010
+ _d.label = 17;
1011
+ case 17: return [2];
1029
1012
  }
1030
1013
  });
1031
1014
  }); };
@@ -1037,28 +1020,26 @@ export var deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemC
1037
1020
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1038
1021
  return [2, deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandError(output, context)];
1039
1022
  }
1040
- contents = {
1023
+ contents = map({
1041
1024
  $metadata: deserializeMetadata(output),
1042
- FailedDisassociatedResources: undefined,
1043
- SuccessfullyDisassociatedResources: undefined,
1044
- };
1025
+ });
1045
1026
  _a = __expectNonNull;
1046
1027
  _b = __expectObject;
1047
1028
  return [4, parseBody(output.body, context)];
1048
1029
  case 1:
1049
1030
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1050
- if (data.FailedDisassociatedResources !== undefined && data.FailedDisassociatedResources !== null) {
1031
+ if (data.FailedDisassociatedResources != null) {
1051
1032
  contents.FailedDisassociatedResources = deserializeAws_restJson1DisassociateResourcesResponseList(data.FailedDisassociatedResources, context);
1052
1033
  }
1053
- if (data.SuccessfullyDisassociatedResources !== undefined && data.SuccessfullyDisassociatedResources !== null) {
1034
+ if (data.SuccessfullyDisassociatedResources != null) {
1054
1035
  contents.SuccessfullyDisassociatedResources = deserializeAws_restJson1DisassociateResourcesResponseList(data.SuccessfullyDisassociatedResources, context);
1055
1036
  }
1056
- return [2, Promise.resolve(contents)];
1037
+ return [2, contents];
1057
1038
  }
1058
1039
  });
1059
1040
  }); };
1060
1041
  var deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1061
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1042
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1062
1043
  var _c;
1063
1044
  return __generator(this, function (_d) {
1064
1045
  switch (_d.label) {
@@ -1099,14 +1080,14 @@ var deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandE
1099
1080
  case 13: throw _d.sent();
1100
1081
  case 14:
1101
1082
  parsedBody = parsedOutput.body;
1102
- $metadata = deserializeMetadata(output);
1103
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1104
- response = new __BaseException({
1105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1106
- $fault: "client",
1107
- $metadata: $metadata,
1083
+ throwDefaultError({
1084
+ output: output,
1085
+ parsedBody: parsedBody,
1086
+ exceptionCtor: __BaseException,
1087
+ errorCode: errorCode,
1108
1088
  });
1109
- throw __decorateServiceException(response, parsedBody);
1089
+ _d.label = 15;
1090
+ case 15: return [2];
1110
1091
  }
1111
1092
  });
1112
1093
  }); };
@@ -1118,24 +1099,23 @@ export var deserializeAws_restJson1CreateBillingGroupCommand = function (output,
1118
1099
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1119
1100
  return [2, deserializeAws_restJson1CreateBillingGroupCommandError(output, context)];
1120
1101
  }
1121
- contents = {
1102
+ contents = map({
1122
1103
  $metadata: deserializeMetadata(output),
1123
- Arn: undefined,
1124
- };
1104
+ });
1125
1105
  _a = __expectNonNull;
1126
1106
  _b = __expectObject;
1127
1107
  return [4, parseBody(output.body, context)];
1128
1108
  case 1:
1129
1109
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1130
- if (data.Arn !== undefined && data.Arn !== null) {
1110
+ if (data.Arn != null) {
1131
1111
  contents.Arn = __expectString(data.Arn);
1132
1112
  }
1133
- return [2, Promise.resolve(contents)];
1113
+ return [2, contents];
1134
1114
  }
1135
1115
  });
1136
1116
  }); };
1137
1117
  var deserializeAws_restJson1CreateBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1138
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1118
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1139
1119
  var _c;
1140
1120
  return __generator(this, function (_d) {
1141
1121
  switch (_d.label) {
@@ -1176,14 +1156,14 @@ var deserializeAws_restJson1CreateBillingGroupCommandError = function (output, c
1176
1156
  case 13: throw _d.sent();
1177
1157
  case 14:
1178
1158
  parsedBody = parsedOutput.body;
1179
- $metadata = deserializeMetadata(output);
1180
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1181
- response = new __BaseException({
1182
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1183
- $fault: "client",
1184
- $metadata: $metadata,
1159
+ throwDefaultError({
1160
+ output: output,
1161
+ parsedBody: parsedBody,
1162
+ exceptionCtor: __BaseException,
1163
+ errorCode: errorCode,
1185
1164
  });
1186
- throw __decorateServiceException(response, parsedBody);
1165
+ _d.label = 15;
1166
+ case 15: return [2];
1187
1167
  }
1188
1168
  });
1189
1169
  }); };
@@ -1195,24 +1175,23 @@ export var deserializeAws_restJson1CreateCustomLineItemCommand = function (outpu
1195
1175
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1196
1176
  return [2, deserializeAws_restJson1CreateCustomLineItemCommandError(output, context)];
1197
1177
  }
1198
- contents = {
1178
+ contents = map({
1199
1179
  $metadata: deserializeMetadata(output),
1200
- Arn: undefined,
1201
- };
1180
+ });
1202
1181
  _a = __expectNonNull;
1203
1182
  _b = __expectObject;
1204
1183
  return [4, parseBody(output.body, context)];
1205
1184
  case 1:
1206
1185
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1207
- if (data.Arn !== undefined && data.Arn !== null) {
1186
+ if (data.Arn != null) {
1208
1187
  contents.Arn = __expectString(data.Arn);
1209
1188
  }
1210
- return [2, Promise.resolve(contents)];
1189
+ return [2, contents];
1211
1190
  }
1212
1191
  });
1213
1192
  }); };
1214
1193
  var deserializeAws_restJson1CreateCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1215
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1194
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1216
1195
  var _c;
1217
1196
  return __generator(this, function (_d) {
1218
1197
  switch (_d.label) {
@@ -1253,14 +1232,14 @@ var deserializeAws_restJson1CreateCustomLineItemCommandError = function (output,
1253
1232
  case 13: throw _d.sent();
1254
1233
  case 14:
1255
1234
  parsedBody = parsedOutput.body;
1256
- $metadata = deserializeMetadata(output);
1257
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1258
- response = new __BaseException({
1259
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1260
- $fault: "client",
1261
- $metadata: $metadata,
1235
+ throwDefaultError({
1236
+ output: output,
1237
+ parsedBody: parsedBody,
1238
+ exceptionCtor: __BaseException,
1239
+ errorCode: errorCode,
1262
1240
  });
1263
- throw __decorateServiceException(response, parsedBody);
1241
+ _d.label = 15;
1242
+ case 15: return [2];
1264
1243
  }
1265
1244
  });
1266
1245
  }); };
@@ -1272,24 +1251,23 @@ export var deserializeAws_restJson1CreatePricingPlanCommand = function (output,
1272
1251
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1273
1252
  return [2, deserializeAws_restJson1CreatePricingPlanCommandError(output, context)];
1274
1253
  }
1275
- contents = {
1254
+ contents = map({
1276
1255
  $metadata: deserializeMetadata(output),
1277
- Arn: undefined,
1278
- };
1256
+ });
1279
1257
  _a = __expectNonNull;
1280
1258
  _b = __expectObject;
1281
1259
  return [4, parseBody(output.body, context)];
1282
1260
  case 1:
1283
1261
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1284
- if (data.Arn !== undefined && data.Arn !== null) {
1262
+ if (data.Arn != null) {
1285
1263
  contents.Arn = __expectString(data.Arn);
1286
1264
  }
1287
- return [2, Promise.resolve(contents)];
1265
+ return [2, contents];
1288
1266
  }
1289
1267
  });
1290
1268
  }); };
1291
1269
  var deserializeAws_restJson1CreatePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1292
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1270
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1293
1271
  var _c;
1294
1272
  return __generator(this, function (_d) {
1295
1273
  switch (_d.label) {
@@ -1334,14 +1312,14 @@ var deserializeAws_restJson1CreatePricingPlanCommandError = function (output, co
1334
1312
  case 15: throw _d.sent();
1335
1313
  case 16:
1336
1314
  parsedBody = parsedOutput.body;
1337
- $metadata = deserializeMetadata(output);
1338
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1339
- response = new __BaseException({
1340
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1341
- $fault: "client",
1342
- $metadata: $metadata,
1315
+ throwDefaultError({
1316
+ output: output,
1317
+ parsedBody: parsedBody,
1318
+ exceptionCtor: __BaseException,
1319
+ errorCode: errorCode,
1343
1320
  });
1344
- throw __decorateServiceException(response, parsedBody);
1321
+ _d.label = 17;
1322
+ case 17: return [2];
1345
1323
  }
1346
1324
  });
1347
1325
  }); };
@@ -1353,24 +1331,23 @@ export var deserializeAws_restJson1CreatePricingRuleCommand = function (output,
1353
1331
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1354
1332
  return [2, deserializeAws_restJson1CreatePricingRuleCommandError(output, context)];
1355
1333
  }
1356
- contents = {
1334
+ contents = map({
1357
1335
  $metadata: deserializeMetadata(output),
1358
- Arn: undefined,
1359
- };
1336
+ });
1360
1337
  _a = __expectNonNull;
1361
1338
  _b = __expectObject;
1362
1339
  return [4, parseBody(output.body, context)];
1363
1340
  case 1:
1364
1341
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1365
- if (data.Arn !== undefined && data.Arn !== null) {
1342
+ if (data.Arn != null) {
1366
1343
  contents.Arn = __expectString(data.Arn);
1367
1344
  }
1368
- return [2, Promise.resolve(contents)];
1345
+ return [2, contents];
1369
1346
  }
1370
1347
  });
1371
1348
  }); };
1372
1349
  var deserializeAws_restJson1CreatePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1373
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1350
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1374
1351
  var _c;
1375
1352
  return __generator(this, function (_d) {
1376
1353
  switch (_d.label) {
@@ -1411,14 +1388,14 @@ var deserializeAws_restJson1CreatePricingRuleCommandError = function (output, co
1411
1388
  case 13: throw _d.sent();
1412
1389
  case 14:
1413
1390
  parsedBody = parsedOutput.body;
1414
- $metadata = deserializeMetadata(output);
1415
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1416
- response = new __BaseException({
1417
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1418
- $fault: "client",
1419
- $metadata: $metadata,
1391
+ throwDefaultError({
1392
+ output: output,
1393
+ parsedBody: parsedBody,
1394
+ exceptionCtor: __BaseException,
1395
+ errorCode: errorCode,
1420
1396
  });
1421
- throw __decorateServiceException(response, parsedBody);
1397
+ _d.label = 15;
1398
+ case 15: return [2];
1422
1399
  }
1423
1400
  });
1424
1401
  }); };
@@ -1430,24 +1407,23 @@ export var deserializeAws_restJson1DeleteBillingGroupCommand = function (output,
1430
1407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1431
1408
  return [2, deserializeAws_restJson1DeleteBillingGroupCommandError(output, context)];
1432
1409
  }
1433
- contents = {
1410
+ contents = map({
1434
1411
  $metadata: deserializeMetadata(output),
1435
- Arn: undefined,
1436
- };
1412
+ });
1437
1413
  _a = __expectNonNull;
1438
1414
  _b = __expectObject;
1439
1415
  return [4, parseBody(output.body, context)];
1440
1416
  case 1:
1441
1417
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1442
- if (data.Arn !== undefined && data.Arn !== null) {
1418
+ if (data.Arn != null) {
1443
1419
  contents.Arn = __expectString(data.Arn);
1444
1420
  }
1445
- return [2, Promise.resolve(contents)];
1421
+ return [2, contents];
1446
1422
  }
1447
1423
  });
1448
1424
  }); };
1449
1425
  var deserializeAws_restJson1DeleteBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1450
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1426
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1451
1427
  var _c;
1452
1428
  return __generator(this, function (_d) {
1453
1429
  switch (_d.label) {
@@ -1480,14 +1456,14 @@ var deserializeAws_restJson1DeleteBillingGroupCommandError = function (output, c
1480
1456
  case 9: throw _d.sent();
1481
1457
  case 10:
1482
1458
  parsedBody = parsedOutput.body;
1483
- $metadata = deserializeMetadata(output);
1484
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1485
- response = new __BaseException({
1486
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1487
- $fault: "client",
1488
- $metadata: $metadata,
1459
+ throwDefaultError({
1460
+ output: output,
1461
+ parsedBody: parsedBody,
1462
+ exceptionCtor: __BaseException,
1463
+ errorCode: errorCode,
1489
1464
  });
1490
- throw __decorateServiceException(response, parsedBody);
1465
+ _d.label = 11;
1466
+ case 11: return [2];
1491
1467
  }
1492
1468
  });
1493
1469
  }); };
@@ -1499,24 +1475,23 @@ export var deserializeAws_restJson1DeleteCustomLineItemCommand = function (outpu
1499
1475
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1500
1476
  return [2, deserializeAws_restJson1DeleteCustomLineItemCommandError(output, context)];
1501
1477
  }
1502
- contents = {
1478
+ contents = map({
1503
1479
  $metadata: deserializeMetadata(output),
1504
- Arn: undefined,
1505
- };
1480
+ });
1506
1481
  _a = __expectNonNull;
1507
1482
  _b = __expectObject;
1508
1483
  return [4, parseBody(output.body, context)];
1509
1484
  case 1:
1510
1485
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1511
- if (data.Arn !== undefined && data.Arn !== null) {
1486
+ if (data.Arn != null) {
1512
1487
  contents.Arn = __expectString(data.Arn);
1513
1488
  }
1514
- return [2, Promise.resolve(contents)];
1489
+ return [2, contents];
1515
1490
  }
1516
1491
  });
1517
1492
  }); };
1518
1493
  var deserializeAws_restJson1DeleteCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1519
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1494
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1520
1495
  var _c;
1521
1496
  return __generator(this, function (_d) {
1522
1497
  switch (_d.label) {
@@ -1553,14 +1528,14 @@ var deserializeAws_restJson1DeleteCustomLineItemCommandError = function (output,
1553
1528
  case 11: throw _d.sent();
1554
1529
  case 12:
1555
1530
  parsedBody = parsedOutput.body;
1556
- $metadata = deserializeMetadata(output);
1557
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1558
- response = new __BaseException({
1559
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1560
- $fault: "client",
1561
- $metadata: $metadata,
1531
+ throwDefaultError({
1532
+ output: output,
1533
+ parsedBody: parsedBody,
1534
+ exceptionCtor: __BaseException,
1535
+ errorCode: errorCode,
1562
1536
  });
1563
- throw __decorateServiceException(response, parsedBody);
1537
+ _d.label = 13;
1538
+ case 13: return [2];
1564
1539
  }
1565
1540
  });
1566
1541
  }); };
@@ -1572,24 +1547,23 @@ export var deserializeAws_restJson1DeletePricingPlanCommand = function (output,
1572
1547
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1573
1548
  return [2, deserializeAws_restJson1DeletePricingPlanCommandError(output, context)];
1574
1549
  }
1575
- contents = {
1550
+ contents = map({
1576
1551
  $metadata: deserializeMetadata(output),
1577
- Arn: undefined,
1578
- };
1552
+ });
1579
1553
  _a = __expectNonNull;
1580
1554
  _b = __expectObject;
1581
1555
  return [4, parseBody(output.body, context)];
1582
1556
  case 1:
1583
1557
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1584
- if (data.Arn !== undefined && data.Arn !== null) {
1558
+ if (data.Arn != null) {
1585
1559
  contents.Arn = __expectString(data.Arn);
1586
1560
  }
1587
- return [2, Promise.resolve(contents)];
1561
+ return [2, contents];
1588
1562
  }
1589
1563
  });
1590
1564
  }); };
1591
1565
  var deserializeAws_restJson1DeletePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1592
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1566
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1593
1567
  var _c;
1594
1568
  return __generator(this, function (_d) {
1595
1569
  switch (_d.label) {
@@ -1626,14 +1600,14 @@ var deserializeAws_restJson1DeletePricingPlanCommandError = function (output, co
1626
1600
  case 11: throw _d.sent();
1627
1601
  case 12:
1628
1602
  parsedBody = parsedOutput.body;
1629
- $metadata = deserializeMetadata(output);
1630
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1631
- response = new __BaseException({
1632
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1633
- $fault: "client",
1634
- $metadata: $metadata,
1603
+ throwDefaultError({
1604
+ output: output,
1605
+ parsedBody: parsedBody,
1606
+ exceptionCtor: __BaseException,
1607
+ errorCode: errorCode,
1635
1608
  });
1636
- throw __decorateServiceException(response, parsedBody);
1609
+ _d.label = 13;
1610
+ case 13: return [2];
1637
1611
  }
1638
1612
  });
1639
1613
  }); };
@@ -1645,24 +1619,23 @@ export var deserializeAws_restJson1DeletePricingRuleCommand = function (output,
1645
1619
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1646
1620
  return [2, deserializeAws_restJson1DeletePricingRuleCommandError(output, context)];
1647
1621
  }
1648
- contents = {
1622
+ contents = map({
1649
1623
  $metadata: deserializeMetadata(output),
1650
- Arn: undefined,
1651
- };
1624
+ });
1652
1625
  _a = __expectNonNull;
1653
1626
  _b = __expectObject;
1654
1627
  return [4, parseBody(output.body, context)];
1655
1628
  case 1:
1656
1629
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1657
- if (data.Arn !== undefined && data.Arn !== null) {
1630
+ if (data.Arn != null) {
1658
1631
  contents.Arn = __expectString(data.Arn);
1659
1632
  }
1660
- return [2, Promise.resolve(contents)];
1633
+ return [2, contents];
1661
1634
  }
1662
1635
  });
1663
1636
  }); };
1664
1637
  var deserializeAws_restJson1DeletePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1665
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1638
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1666
1639
  var _c;
1667
1640
  return __generator(this, function (_d) {
1668
1641
  switch (_d.label) {
@@ -1699,14 +1672,14 @@ var deserializeAws_restJson1DeletePricingRuleCommandError = function (output, co
1699
1672
  case 11: throw _d.sent();
1700
1673
  case 12:
1701
1674
  parsedBody = parsedOutput.body;
1702
- $metadata = deserializeMetadata(output);
1703
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1704
- response = new __BaseException({
1705
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1706
- $fault: "client",
1707
- $metadata: $metadata,
1675
+ throwDefaultError({
1676
+ output: output,
1677
+ parsedBody: parsedBody,
1678
+ exceptionCtor: __BaseException,
1679
+ errorCode: errorCode,
1708
1680
  });
1709
- throw __decorateServiceException(response, parsedBody);
1681
+ _d.label = 13;
1682
+ case 13: return [2];
1710
1683
  }
1711
1684
  });
1712
1685
  }); };
@@ -1718,24 +1691,23 @@ export var deserializeAws_restJson1DisassociateAccountsCommand = function (outpu
1718
1691
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1719
1692
  return [2, deserializeAws_restJson1DisassociateAccountsCommandError(output, context)];
1720
1693
  }
1721
- contents = {
1694
+ contents = map({
1722
1695
  $metadata: deserializeMetadata(output),
1723
- Arn: undefined,
1724
- };
1696
+ });
1725
1697
  _a = __expectNonNull;
1726
1698
  _b = __expectObject;
1727
1699
  return [4, parseBody(output.body, context)];
1728
1700
  case 1:
1729
1701
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1730
- if (data.Arn !== undefined && data.Arn !== null) {
1702
+ if (data.Arn != null) {
1731
1703
  contents.Arn = __expectString(data.Arn);
1732
1704
  }
1733
- return [2, Promise.resolve(contents)];
1705
+ return [2, contents];
1734
1706
  }
1735
1707
  });
1736
1708
  }); };
1737
1709
  var deserializeAws_restJson1DisassociateAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1738
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1710
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1739
1711
  var _c;
1740
1712
  return __generator(this, function (_d) {
1741
1713
  switch (_d.label) {
@@ -1776,14 +1748,14 @@ var deserializeAws_restJson1DisassociateAccountsCommandError = function (output,
1776
1748
  case 13: throw _d.sent();
1777
1749
  case 14:
1778
1750
  parsedBody = parsedOutput.body;
1779
- $metadata = deserializeMetadata(output);
1780
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1781
- response = new __BaseException({
1782
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1783
- $fault: "client",
1784
- $metadata: $metadata,
1751
+ throwDefaultError({
1752
+ output: output,
1753
+ parsedBody: parsedBody,
1754
+ exceptionCtor: __BaseException,
1755
+ errorCode: errorCode,
1785
1756
  });
1786
- throw __decorateServiceException(response, parsedBody);
1757
+ _d.label = 15;
1758
+ case 15: return [2];
1787
1759
  }
1788
1760
  });
1789
1761
  }); };
@@ -1795,24 +1767,23 @@ export var deserializeAws_restJson1DisassociatePricingRulesCommand = function (o
1795
1767
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1796
1768
  return [2, deserializeAws_restJson1DisassociatePricingRulesCommandError(output, context)];
1797
1769
  }
1798
- contents = {
1770
+ contents = map({
1799
1771
  $metadata: deserializeMetadata(output),
1800
- Arn: undefined,
1801
- };
1772
+ });
1802
1773
  _a = __expectNonNull;
1803
1774
  _b = __expectObject;
1804
1775
  return [4, parseBody(output.body, context)];
1805
1776
  case 1:
1806
1777
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1807
- if (data.Arn !== undefined && data.Arn !== null) {
1778
+ if (data.Arn != null) {
1808
1779
  contents.Arn = __expectString(data.Arn);
1809
1780
  }
1810
- return [2, Promise.resolve(contents)];
1781
+ return [2, contents];
1811
1782
  }
1812
1783
  });
1813
1784
  }); };
1814
1785
  var deserializeAws_restJson1DisassociatePricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1815
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1786
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1816
1787
  var _c;
1817
1788
  return __generator(this, function (_d) {
1818
1789
  switch (_d.label) {
@@ -1853,14 +1824,14 @@ var deserializeAws_restJson1DisassociatePricingRulesCommandError = function (out
1853
1824
  case 13: throw _d.sent();
1854
1825
  case 14:
1855
1826
  parsedBody = parsedOutput.body;
1856
- $metadata = deserializeMetadata(output);
1857
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1858
- response = new __BaseException({
1859
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1860
- $fault: "client",
1861
- $metadata: $metadata,
1827
+ throwDefaultError({
1828
+ output: output,
1829
+ parsedBody: parsedBody,
1830
+ exceptionCtor: __BaseException,
1831
+ errorCode: errorCode,
1862
1832
  });
1863
- throw __decorateServiceException(response, parsedBody);
1833
+ _d.label = 15;
1834
+ case 15: return [2];
1864
1835
  }
1865
1836
  });
1866
1837
  }); };
@@ -1872,28 +1843,26 @@ export var deserializeAws_restJson1ListAccountAssociationsCommand = function (ou
1872
1843
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1873
1844
  return [2, deserializeAws_restJson1ListAccountAssociationsCommandError(output, context)];
1874
1845
  }
1875
- contents = {
1846
+ contents = map({
1876
1847
  $metadata: deserializeMetadata(output),
1877
- LinkedAccounts: undefined,
1878
- NextToken: undefined,
1879
- };
1848
+ });
1880
1849
  _a = __expectNonNull;
1881
1850
  _b = __expectObject;
1882
1851
  return [4, parseBody(output.body, context)];
1883
1852
  case 1:
1884
1853
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1885
- if (data.LinkedAccounts !== undefined && data.LinkedAccounts !== null) {
1854
+ if (data.LinkedAccounts != null) {
1886
1855
  contents.LinkedAccounts = deserializeAws_restJson1AccountAssociationsList(data.LinkedAccounts, context);
1887
1856
  }
1888
- if (data.NextToken !== undefined && data.NextToken !== null) {
1857
+ if (data.NextToken != null) {
1889
1858
  contents.NextToken = __expectString(data.NextToken);
1890
1859
  }
1891
- return [2, Promise.resolve(contents)];
1860
+ return [2, contents];
1892
1861
  }
1893
1862
  });
1894
1863
  }); };
1895
1864
  var deserializeAws_restJson1ListAccountAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1896
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1865
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1897
1866
  var _c;
1898
1867
  return __generator(this, function (_d) {
1899
1868
  switch (_d.label) {
@@ -1930,14 +1899,14 @@ var deserializeAws_restJson1ListAccountAssociationsCommandError = function (outp
1930
1899
  case 11: throw _d.sent();
1931
1900
  case 12:
1932
1901
  parsedBody = parsedOutput.body;
1933
- $metadata = deserializeMetadata(output);
1934
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1935
- response = new __BaseException({
1936
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1937
- $fault: "client",
1938
- $metadata: $metadata,
1902
+ throwDefaultError({
1903
+ output: output,
1904
+ parsedBody: parsedBody,
1905
+ exceptionCtor: __BaseException,
1906
+ errorCode: errorCode,
1939
1907
  });
1940
- throw __decorateServiceException(response, parsedBody);
1908
+ _d.label = 13;
1909
+ case 13: return [2];
1941
1910
  }
1942
1911
  });
1943
1912
  }); };
@@ -1949,28 +1918,26 @@ export var deserializeAws_restJson1ListBillingGroupCostReportsCommand = function
1949
1918
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1950
1919
  return [2, deserializeAws_restJson1ListBillingGroupCostReportsCommandError(output, context)];
1951
1920
  }
1952
- contents = {
1921
+ contents = map({
1953
1922
  $metadata: deserializeMetadata(output),
1954
- BillingGroupCostReports: undefined,
1955
- NextToken: undefined,
1956
- };
1923
+ });
1957
1924
  _a = __expectNonNull;
1958
1925
  _b = __expectObject;
1959
1926
  return [4, parseBody(output.body, context)];
1960
1927
  case 1:
1961
1928
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1962
- if (data.BillingGroupCostReports !== undefined && data.BillingGroupCostReports !== null) {
1929
+ if (data.BillingGroupCostReports != null) {
1963
1930
  contents.BillingGroupCostReports = deserializeAws_restJson1BillingGroupCostReportList(data.BillingGroupCostReports, context);
1964
1931
  }
1965
- if (data.NextToken !== undefined && data.NextToken !== null) {
1932
+ if (data.NextToken != null) {
1966
1933
  contents.NextToken = __expectString(data.NextToken);
1967
1934
  }
1968
- return [2, Promise.resolve(contents)];
1935
+ return [2, contents];
1969
1936
  }
1970
1937
  });
1971
1938
  }); };
1972
1939
  var deserializeAws_restJson1ListBillingGroupCostReportsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1973
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1940
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1974
1941
  var _c;
1975
1942
  return __generator(this, function (_d) {
1976
1943
  switch (_d.label) {
@@ -2007,14 +1974,14 @@ var deserializeAws_restJson1ListBillingGroupCostReportsCommandError = function (
2007
1974
  case 11: throw _d.sent();
2008
1975
  case 12:
2009
1976
  parsedBody = parsedOutput.body;
2010
- $metadata = deserializeMetadata(output);
2011
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2012
- response = new __BaseException({
2013
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2014
- $fault: "client",
2015
- $metadata: $metadata,
1977
+ throwDefaultError({
1978
+ output: output,
1979
+ parsedBody: parsedBody,
1980
+ exceptionCtor: __BaseException,
1981
+ errorCode: errorCode,
2016
1982
  });
2017
- throw __decorateServiceException(response, parsedBody);
1983
+ _d.label = 13;
1984
+ case 13: return [2];
2018
1985
  }
2019
1986
  });
2020
1987
  }); };
@@ -2026,28 +1993,26 @@ export var deserializeAws_restJson1ListBillingGroupsCommand = function (output,
2026
1993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2027
1994
  return [2, deserializeAws_restJson1ListBillingGroupsCommandError(output, context)];
2028
1995
  }
2029
- contents = {
1996
+ contents = map({
2030
1997
  $metadata: deserializeMetadata(output),
2031
- BillingGroups: undefined,
2032
- NextToken: undefined,
2033
- };
1998
+ });
2034
1999
  _a = __expectNonNull;
2035
2000
  _b = __expectObject;
2036
2001
  return [4, parseBody(output.body, context)];
2037
2002
  case 1:
2038
2003
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2039
- if (data.BillingGroups !== undefined && data.BillingGroups !== null) {
2004
+ if (data.BillingGroups != null) {
2040
2005
  contents.BillingGroups = deserializeAws_restJson1BillingGroupList(data.BillingGroups, context);
2041
2006
  }
2042
- if (data.NextToken !== undefined && data.NextToken !== null) {
2007
+ if (data.NextToken != null) {
2043
2008
  contents.NextToken = __expectString(data.NextToken);
2044
2009
  }
2045
- return [2, Promise.resolve(contents)];
2010
+ return [2, contents];
2046
2011
  }
2047
2012
  });
2048
2013
  }); };
2049
2014
  var deserializeAws_restJson1ListBillingGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2050
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2015
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2051
2016
  var _c;
2052
2017
  return __generator(this, function (_d) {
2053
2018
  switch (_d.label) {
@@ -2084,14 +2049,14 @@ var deserializeAws_restJson1ListBillingGroupsCommandError = function (output, co
2084
2049
  case 11: throw _d.sent();
2085
2050
  case 12:
2086
2051
  parsedBody = parsedOutput.body;
2087
- $metadata = deserializeMetadata(output);
2088
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2089
- response = new __BaseException({
2090
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2091
- $fault: "client",
2092
- $metadata: $metadata,
2052
+ throwDefaultError({
2053
+ output: output,
2054
+ parsedBody: parsedBody,
2055
+ exceptionCtor: __BaseException,
2056
+ errorCode: errorCode,
2093
2057
  });
2094
- throw __decorateServiceException(response, parsedBody);
2058
+ _d.label = 13;
2059
+ case 13: return [2];
2095
2060
  }
2096
2061
  });
2097
2062
  }); };
@@ -2103,28 +2068,26 @@ export var deserializeAws_restJson1ListCustomLineItemsCommand = function (output
2103
2068
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2104
2069
  return [2, deserializeAws_restJson1ListCustomLineItemsCommandError(output, context)];
2105
2070
  }
2106
- contents = {
2071
+ contents = map({
2107
2072
  $metadata: deserializeMetadata(output),
2108
- CustomLineItems: undefined,
2109
- NextToken: undefined,
2110
- };
2073
+ });
2111
2074
  _a = __expectNonNull;
2112
2075
  _b = __expectObject;
2113
2076
  return [4, parseBody(output.body, context)];
2114
2077
  case 1:
2115
2078
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2116
- if (data.CustomLineItems !== undefined && data.CustomLineItems !== null) {
2079
+ if (data.CustomLineItems != null) {
2117
2080
  contents.CustomLineItems = deserializeAws_restJson1CustomLineItemList(data.CustomLineItems, context);
2118
2081
  }
2119
- if (data.NextToken !== undefined && data.NextToken !== null) {
2082
+ if (data.NextToken != null) {
2120
2083
  contents.NextToken = __expectString(data.NextToken);
2121
2084
  }
2122
- return [2, Promise.resolve(contents)];
2085
+ return [2, contents];
2123
2086
  }
2124
2087
  });
2125
2088
  }); };
2126
2089
  var deserializeAws_restJson1ListCustomLineItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2127
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2090
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2128
2091
  var _c;
2129
2092
  return __generator(this, function (_d) {
2130
2093
  switch (_d.label) {
@@ -2161,14 +2124,14 @@ var deserializeAws_restJson1ListCustomLineItemsCommandError = function (output,
2161
2124
  case 11: throw _d.sent();
2162
2125
  case 12:
2163
2126
  parsedBody = parsedOutput.body;
2164
- $metadata = deserializeMetadata(output);
2165
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2166
- response = new __BaseException({
2167
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2168
- $fault: "client",
2169
- $metadata: $metadata,
2127
+ throwDefaultError({
2128
+ output: output,
2129
+ parsedBody: parsedBody,
2130
+ exceptionCtor: __BaseException,
2131
+ errorCode: errorCode,
2170
2132
  });
2171
- throw __decorateServiceException(response, parsedBody);
2133
+ _d.label = 13;
2134
+ case 13: return [2];
2172
2135
  }
2173
2136
  });
2174
2137
  }); };
@@ -2180,32 +2143,29 @@ export var deserializeAws_restJson1ListPricingPlansCommand = function (output, c
2180
2143
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2181
2144
  return [2, deserializeAws_restJson1ListPricingPlansCommandError(output, context)];
2182
2145
  }
2183
- contents = {
2146
+ contents = map({
2184
2147
  $metadata: deserializeMetadata(output),
2185
- BillingPeriod: undefined,
2186
- NextToken: undefined,
2187
- PricingPlans: undefined,
2188
- };
2148
+ });
2189
2149
  _a = __expectNonNull;
2190
2150
  _b = __expectObject;
2191
2151
  return [4, parseBody(output.body, context)];
2192
2152
  case 1:
2193
2153
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2194
- if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2154
+ if (data.BillingPeriod != null) {
2195
2155
  contents.BillingPeriod = __expectString(data.BillingPeriod);
2196
2156
  }
2197
- if (data.NextToken !== undefined && data.NextToken !== null) {
2157
+ if (data.NextToken != null) {
2198
2158
  contents.NextToken = __expectString(data.NextToken);
2199
2159
  }
2200
- if (data.PricingPlans !== undefined && data.PricingPlans !== null) {
2160
+ if (data.PricingPlans != null) {
2201
2161
  contents.PricingPlans = deserializeAws_restJson1PricingPlanList(data.PricingPlans, context);
2202
2162
  }
2203
- return [2, Promise.resolve(contents)];
2163
+ return [2, contents];
2204
2164
  }
2205
2165
  });
2206
2166
  }); };
2207
2167
  var deserializeAws_restJson1ListPricingPlansCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2208
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2168
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2209
2169
  var _c;
2210
2170
  return __generator(this, function (_d) {
2211
2171
  switch (_d.label) {
@@ -2238,14 +2198,14 @@ var deserializeAws_restJson1ListPricingPlansCommandError = function (output, con
2238
2198
  case 9: throw _d.sent();
2239
2199
  case 10:
2240
2200
  parsedBody = parsedOutput.body;
2241
- $metadata = deserializeMetadata(output);
2242
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2243
- response = new __BaseException({
2244
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2245
- $fault: "client",
2246
- $metadata: $metadata,
2201
+ throwDefaultError({
2202
+ output: output,
2203
+ parsedBody: parsedBody,
2204
+ exceptionCtor: __BaseException,
2205
+ errorCode: errorCode,
2247
2206
  });
2248
- throw __decorateServiceException(response, parsedBody);
2207
+ _d.label = 11;
2208
+ case 11: return [2];
2249
2209
  }
2250
2210
  });
2251
2211
  }); };
@@ -2257,36 +2217,32 @@ export var deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleComm
2257
2217
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2258
2218
  return [2, deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandError(output, context)];
2259
2219
  }
2260
- contents = {
2220
+ contents = map({
2261
2221
  $metadata: deserializeMetadata(output),
2262
- BillingPeriod: undefined,
2263
- NextToken: undefined,
2264
- PricingPlanArns: undefined,
2265
- PricingRuleArn: undefined,
2266
- };
2222
+ });
2267
2223
  _a = __expectNonNull;
2268
2224
  _b = __expectObject;
2269
2225
  return [4, parseBody(output.body, context)];
2270
2226
  case 1:
2271
2227
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2272
- if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2228
+ if (data.BillingPeriod != null) {
2273
2229
  contents.BillingPeriod = __expectString(data.BillingPeriod);
2274
2230
  }
2275
- if (data.NextToken !== undefined && data.NextToken !== null) {
2231
+ if (data.NextToken != null) {
2276
2232
  contents.NextToken = __expectString(data.NextToken);
2277
2233
  }
2278
- if (data.PricingPlanArns !== undefined && data.PricingPlanArns !== null) {
2234
+ if (data.PricingPlanArns != null) {
2279
2235
  contents.PricingPlanArns = deserializeAws_restJson1PricingPlanArns(data.PricingPlanArns, context);
2280
2236
  }
2281
- if (data.PricingRuleArn !== undefined && data.PricingRuleArn !== null) {
2237
+ if (data.PricingRuleArn != null) {
2282
2238
  contents.PricingRuleArn = __expectString(data.PricingRuleArn);
2283
2239
  }
2284
- return [2, Promise.resolve(contents)];
2240
+ return [2, contents];
2285
2241
  }
2286
2242
  });
2287
2243
  }); };
2288
2244
  var deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2289
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2245
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2290
2246
  var _c;
2291
2247
  return __generator(this, function (_d) {
2292
2248
  switch (_d.label) {
@@ -2323,14 +2279,14 @@ var deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandErro
2323
2279
  case 11: throw _d.sent();
2324
2280
  case 12:
2325
2281
  parsedBody = parsedOutput.body;
2326
- $metadata = deserializeMetadata(output);
2327
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2328
- response = new __BaseException({
2329
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2330
- $fault: "client",
2331
- $metadata: $metadata,
2282
+ throwDefaultError({
2283
+ output: output,
2284
+ parsedBody: parsedBody,
2285
+ exceptionCtor: __BaseException,
2286
+ errorCode: errorCode,
2332
2287
  });
2333
- throw __decorateServiceException(response, parsedBody);
2288
+ _d.label = 13;
2289
+ case 13: return [2];
2334
2290
  }
2335
2291
  });
2336
2292
  }); };
@@ -2342,32 +2298,29 @@ export var deserializeAws_restJson1ListPricingRulesCommand = function (output, c
2342
2298
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2343
2299
  return [2, deserializeAws_restJson1ListPricingRulesCommandError(output, context)];
2344
2300
  }
2345
- contents = {
2301
+ contents = map({
2346
2302
  $metadata: deserializeMetadata(output),
2347
- BillingPeriod: undefined,
2348
- NextToken: undefined,
2349
- PricingRules: undefined,
2350
- };
2303
+ });
2351
2304
  _a = __expectNonNull;
2352
2305
  _b = __expectObject;
2353
2306
  return [4, parseBody(output.body, context)];
2354
2307
  case 1:
2355
2308
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2356
- if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2309
+ if (data.BillingPeriod != null) {
2357
2310
  contents.BillingPeriod = __expectString(data.BillingPeriod);
2358
2311
  }
2359
- if (data.NextToken !== undefined && data.NextToken !== null) {
2312
+ if (data.NextToken != null) {
2360
2313
  contents.NextToken = __expectString(data.NextToken);
2361
2314
  }
2362
- if (data.PricingRules !== undefined && data.PricingRules !== null) {
2315
+ if (data.PricingRules != null) {
2363
2316
  contents.PricingRules = deserializeAws_restJson1PricingRuleList(data.PricingRules, context);
2364
2317
  }
2365
- return [2, Promise.resolve(contents)];
2318
+ return [2, contents];
2366
2319
  }
2367
2320
  });
2368
2321
  }); };
2369
2322
  var deserializeAws_restJson1ListPricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2370
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2323
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2371
2324
  var _c;
2372
2325
  return __generator(this, function (_d) {
2373
2326
  switch (_d.label) {
@@ -2400,14 +2353,14 @@ var deserializeAws_restJson1ListPricingRulesCommandError = function (output, con
2400
2353
  case 9: throw _d.sent();
2401
2354
  case 10:
2402
2355
  parsedBody = parsedOutput.body;
2403
- $metadata = deserializeMetadata(output);
2404
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2405
- response = new __BaseException({
2406
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2407
- $fault: "client",
2408
- $metadata: $metadata,
2356
+ throwDefaultError({
2357
+ output: output,
2358
+ parsedBody: parsedBody,
2359
+ exceptionCtor: __BaseException,
2360
+ errorCode: errorCode,
2409
2361
  });
2410
- throw __decorateServiceException(response, parsedBody);
2362
+ _d.label = 11;
2363
+ case 11: return [2];
2411
2364
  }
2412
2365
  });
2413
2366
  }); };
@@ -2419,36 +2372,32 @@ export var deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanComman
2419
2372
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2420
2373
  return [2, deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError(output, context)];
2421
2374
  }
2422
- contents = {
2375
+ contents = map({
2423
2376
  $metadata: deserializeMetadata(output),
2424
- BillingPeriod: undefined,
2425
- NextToken: undefined,
2426
- PricingPlanArn: undefined,
2427
- PricingRuleArns: undefined,
2428
- };
2377
+ });
2429
2378
  _a = __expectNonNull;
2430
2379
  _b = __expectObject;
2431
2380
  return [4, parseBody(output.body, context)];
2432
2381
  case 1:
2433
2382
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2434
- if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2383
+ if (data.BillingPeriod != null) {
2435
2384
  contents.BillingPeriod = __expectString(data.BillingPeriod);
2436
2385
  }
2437
- if (data.NextToken !== undefined && data.NextToken !== null) {
2386
+ if (data.NextToken != null) {
2438
2387
  contents.NextToken = __expectString(data.NextToken);
2439
2388
  }
2440
- if (data.PricingPlanArn !== undefined && data.PricingPlanArn !== null) {
2389
+ if (data.PricingPlanArn != null) {
2441
2390
  contents.PricingPlanArn = __expectString(data.PricingPlanArn);
2442
2391
  }
2443
- if (data.PricingRuleArns !== undefined && data.PricingRuleArns !== null) {
2392
+ if (data.PricingRuleArns != null) {
2444
2393
  contents.PricingRuleArns = deserializeAws_restJson1PricingRuleArns(data.PricingRuleArns, context);
2445
2394
  }
2446
- return [2, Promise.resolve(contents)];
2395
+ return [2, contents];
2447
2396
  }
2448
2397
  });
2449
2398
  }); };
2450
2399
  var deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2451
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2400
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2452
2401
  var _c;
2453
2402
  return __generator(this, function (_d) {
2454
2403
  switch (_d.label) {
@@ -2485,14 +2434,14 @@ var deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError
2485
2434
  case 11: throw _d.sent();
2486
2435
  case 12:
2487
2436
  parsedBody = parsedOutput.body;
2488
- $metadata = deserializeMetadata(output);
2489
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2490
- response = new __BaseException({
2491
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2492
- $fault: "client",
2493
- $metadata: $metadata,
2437
+ throwDefaultError({
2438
+ output: output,
2439
+ parsedBody: parsedBody,
2440
+ exceptionCtor: __BaseException,
2441
+ errorCode: errorCode,
2494
2442
  });
2495
- throw __decorateServiceException(response, parsedBody);
2443
+ _d.label = 13;
2444
+ case 13: return [2];
2496
2445
  }
2497
2446
  });
2498
2447
  }); };
@@ -2504,32 +2453,29 @@ export var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemComman
2504
2453
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2505
2454
  return [2, deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError(output, context)];
2506
2455
  }
2507
- contents = {
2456
+ contents = map({
2508
2457
  $metadata: deserializeMetadata(output),
2509
- Arn: undefined,
2510
- AssociatedResources: undefined,
2511
- NextToken: undefined,
2512
- };
2458
+ });
2513
2459
  _a = __expectNonNull;
2514
2460
  _b = __expectObject;
2515
2461
  return [4, parseBody(output.body, context)];
2516
2462
  case 1:
2517
2463
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2518
- if (data.Arn !== undefined && data.Arn !== null) {
2464
+ if (data.Arn != null) {
2519
2465
  contents.Arn = __expectString(data.Arn);
2520
2466
  }
2521
- if (data.AssociatedResources !== undefined && data.AssociatedResources !== null) {
2467
+ if (data.AssociatedResources != null) {
2522
2468
  contents.AssociatedResources = deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemResponseList(data.AssociatedResources, context);
2523
2469
  }
2524
- if (data.NextToken !== undefined && data.NextToken !== null) {
2470
+ if (data.NextToken != null) {
2525
2471
  contents.NextToken = __expectString(data.NextToken);
2526
2472
  }
2527
- return [2, Promise.resolve(contents)];
2473
+ return [2, contents];
2528
2474
  }
2529
2475
  });
2530
2476
  }); };
2531
2477
  var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2532
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2478
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2533
2479
  var _c;
2534
2480
  return __generator(this, function (_d) {
2535
2481
  switch (_d.label) {
@@ -2566,14 +2512,14 @@ var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError
2566
2512
  case 11: throw _d.sent();
2567
2513
  case 12:
2568
2514
  parsedBody = parsedOutput.body;
2569
- $metadata = deserializeMetadata(output);
2570
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2571
- response = new __BaseException({
2572
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2573
- $fault: "client",
2574
- $metadata: $metadata,
2515
+ throwDefaultError({
2516
+ output: output,
2517
+ parsedBody: parsedBody,
2518
+ exceptionCtor: __BaseException,
2519
+ errorCode: errorCode,
2575
2520
  });
2576
- throw __decorateServiceException(response, parsedBody);
2521
+ _d.label = 13;
2522
+ case 13: return [2];
2577
2523
  }
2578
2524
  });
2579
2525
  }); };
@@ -2585,24 +2531,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2585
2531
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2586
2532
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2587
2533
  }
2588
- contents = {
2534
+ contents = map({
2589
2535
  $metadata: deserializeMetadata(output),
2590
- Tags: undefined,
2591
- };
2536
+ });
2592
2537
  _a = __expectNonNull;
2593
2538
  _b = __expectObject;
2594
2539
  return [4, parseBody(output.body, context)];
2595
2540
  case 1:
2596
2541
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2597
- if (data.Tags !== undefined && data.Tags !== null) {
2542
+ if (data.Tags != null) {
2598
2543
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2599
2544
  }
2600
- return [2, Promise.resolve(contents)];
2545
+ return [2, contents];
2601
2546
  }
2602
2547
  });
2603
2548
  }); };
2604
2549
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2605
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2550
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2606
2551
  var _c;
2607
2552
  return __generator(this, function (_d) {
2608
2553
  switch (_d.label) {
@@ -2639,14 +2584,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2639
2584
  case 11: throw _d.sent();
2640
2585
  case 12:
2641
2586
  parsedBody = parsedOutput.body;
2642
- $metadata = deserializeMetadata(output);
2643
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2644
- response = new __BaseException({
2645
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2646
- $fault: "client",
2647
- $metadata: $metadata,
2587
+ throwDefaultError({
2588
+ output: output,
2589
+ parsedBody: parsedBody,
2590
+ exceptionCtor: __BaseException,
2591
+ errorCode: errorCode,
2648
2592
  });
2649
- throw __decorateServiceException(response, parsedBody);
2593
+ _d.label = 13;
2594
+ case 13: return [2];
2650
2595
  }
2651
2596
  });
2652
2597
  }); };
@@ -2658,18 +2603,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2658
2603
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2659
2604
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2660
2605
  }
2661
- contents = {
2606
+ contents = map({
2662
2607
  $metadata: deserializeMetadata(output),
2663
- };
2608
+ });
2664
2609
  return [4, collectBody(output.body, context)];
2665
2610
  case 1:
2666
2611
  _a.sent();
2667
- return [2, Promise.resolve(contents)];
2612
+ return [2, contents];
2668
2613
  }
2669
2614
  });
2670
2615
  }); };
2671
2616
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2672
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2617
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2673
2618
  var _c;
2674
2619
  return __generator(this, function (_d) {
2675
2620
  switch (_d.label) {
@@ -2706,14 +2651,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2706
2651
  case 11: throw _d.sent();
2707
2652
  case 12:
2708
2653
  parsedBody = parsedOutput.body;
2709
- $metadata = deserializeMetadata(output);
2710
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2711
- response = new __BaseException({
2712
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2713
- $fault: "client",
2714
- $metadata: $metadata,
2654
+ throwDefaultError({
2655
+ output: output,
2656
+ parsedBody: parsedBody,
2657
+ exceptionCtor: __BaseException,
2658
+ errorCode: errorCode,
2715
2659
  });
2716
- throw __decorateServiceException(response, parsedBody);
2660
+ _d.label = 13;
2661
+ case 13: return [2];
2717
2662
  }
2718
2663
  });
2719
2664
  }); };
@@ -2725,18 +2670,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2725
2670
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2726
2671
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2727
2672
  }
2728
- contents = {
2673
+ contents = map({
2729
2674
  $metadata: deserializeMetadata(output),
2730
- };
2675
+ });
2731
2676
  return [4, collectBody(output.body, context)];
2732
2677
  case 1:
2733
2678
  _a.sent();
2734
- return [2, Promise.resolve(contents)];
2679
+ return [2, contents];
2735
2680
  }
2736
2681
  });
2737
2682
  }); };
2738
2683
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2739
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2684
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2740
2685
  var _c;
2741
2686
  return __generator(this, function (_d) {
2742
2687
  switch (_d.label) {
@@ -2773,14 +2718,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2773
2718
  case 11: throw _d.sent();
2774
2719
  case 12:
2775
2720
  parsedBody = parsedOutput.body;
2776
- $metadata = deserializeMetadata(output);
2777
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2778
- response = new __BaseException({
2779
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2780
- $fault: "client",
2781
- $metadata: $metadata,
2721
+ throwDefaultError({
2722
+ output: output,
2723
+ parsedBody: parsedBody,
2724
+ exceptionCtor: __BaseException,
2725
+ errorCode: errorCode,
2782
2726
  });
2783
- throw __decorateServiceException(response, parsedBody);
2727
+ _d.label = 13;
2728
+ case 13: return [2];
2784
2729
  }
2785
2730
  });
2786
2731
  }); };
@@ -2792,56 +2737,47 @@ export var deserializeAws_restJson1UpdateBillingGroupCommand = function (output,
2792
2737
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2793
2738
  return [2, deserializeAws_restJson1UpdateBillingGroupCommandError(output, context)];
2794
2739
  }
2795
- contents = {
2740
+ contents = map({
2796
2741
  $metadata: deserializeMetadata(output),
2797
- Arn: undefined,
2798
- Description: undefined,
2799
- LastModifiedTime: undefined,
2800
- Name: undefined,
2801
- PricingPlanArn: undefined,
2802
- PrimaryAccountId: undefined,
2803
- Size: undefined,
2804
- Status: undefined,
2805
- StatusReason: undefined,
2806
- };
2742
+ });
2807
2743
  _a = __expectNonNull;
2808
2744
  _b = __expectObject;
2809
2745
  return [4, parseBody(output.body, context)];
2810
2746
  case 1:
2811
2747
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2812
- if (data.Arn !== undefined && data.Arn !== null) {
2748
+ if (data.Arn != null) {
2813
2749
  contents.Arn = __expectString(data.Arn);
2814
2750
  }
2815
- if (data.Description !== undefined && data.Description !== null) {
2751
+ if (data.Description != null) {
2816
2752
  contents.Description = __expectString(data.Description);
2817
2753
  }
2818
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2754
+ if (data.LastModifiedTime != null) {
2819
2755
  contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2820
2756
  }
2821
- if (data.Name !== undefined && data.Name !== null) {
2757
+ if (data.Name != null) {
2822
2758
  contents.Name = __expectString(data.Name);
2823
2759
  }
2824
- if (data.PricingPlanArn !== undefined && data.PricingPlanArn !== null) {
2760
+ if (data.PricingPlanArn != null) {
2825
2761
  contents.PricingPlanArn = __expectString(data.PricingPlanArn);
2826
2762
  }
2827
- if (data.PrimaryAccountId !== undefined && data.PrimaryAccountId !== null) {
2763
+ if (data.PrimaryAccountId != null) {
2828
2764
  contents.PrimaryAccountId = __expectString(data.PrimaryAccountId);
2829
2765
  }
2830
- if (data.Size !== undefined && data.Size !== null) {
2766
+ if (data.Size != null) {
2831
2767
  contents.Size = __expectLong(data.Size);
2832
2768
  }
2833
- if (data.Status !== undefined && data.Status !== null) {
2769
+ if (data.Status != null) {
2834
2770
  contents.Status = __expectString(data.Status);
2835
2771
  }
2836
- if (data.StatusReason !== undefined && data.StatusReason !== null) {
2772
+ if (data.StatusReason != null) {
2837
2773
  contents.StatusReason = __expectString(data.StatusReason);
2838
2774
  }
2839
- return [2, Promise.resolve(contents)];
2775
+ return [2, contents];
2840
2776
  }
2841
2777
  });
2842
2778
  }); };
2843
2779
  var deserializeAws_restJson1UpdateBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2844
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2780
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2845
2781
  var _c;
2846
2782
  return __generator(this, function (_d) {
2847
2783
  switch (_d.label) {
@@ -2882,14 +2818,14 @@ var deserializeAws_restJson1UpdateBillingGroupCommandError = function (output, c
2882
2818
  case 13: throw _d.sent();
2883
2819
  case 14:
2884
2820
  parsedBody = parsedOutput.body;
2885
- $metadata = deserializeMetadata(output);
2886
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2887
- response = new __BaseException({
2888
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2889
- $fault: "client",
2890
- $metadata: $metadata,
2821
+ throwDefaultError({
2822
+ output: output,
2823
+ parsedBody: parsedBody,
2824
+ exceptionCtor: __BaseException,
2825
+ errorCode: errorCode,
2891
2826
  });
2892
- throw __decorateServiceException(response, parsedBody);
2827
+ _d.label = 15;
2828
+ case 15: return [2];
2893
2829
  }
2894
2830
  });
2895
2831
  }); };
@@ -2901,48 +2837,41 @@ export var deserializeAws_restJson1UpdateCustomLineItemCommand = function (outpu
2901
2837
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2902
2838
  return [2, deserializeAws_restJson1UpdateCustomLineItemCommandError(output, context)];
2903
2839
  }
2904
- contents = {
2840
+ contents = map({
2905
2841
  $metadata: deserializeMetadata(output),
2906
- Arn: undefined,
2907
- AssociationSize: undefined,
2908
- BillingGroupArn: undefined,
2909
- ChargeDetails: undefined,
2910
- Description: undefined,
2911
- LastModifiedTime: undefined,
2912
- Name: undefined,
2913
- };
2842
+ });
2914
2843
  _a = __expectNonNull;
2915
2844
  _b = __expectObject;
2916
2845
  return [4, parseBody(output.body, context)];
2917
2846
  case 1:
2918
2847
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2919
- if (data.Arn !== undefined && data.Arn !== null) {
2848
+ if (data.Arn != null) {
2920
2849
  contents.Arn = __expectString(data.Arn);
2921
2850
  }
2922
- if (data.AssociationSize !== undefined && data.AssociationSize !== null) {
2851
+ if (data.AssociationSize != null) {
2923
2852
  contents.AssociationSize = __expectLong(data.AssociationSize);
2924
2853
  }
2925
- if (data.BillingGroupArn !== undefined && data.BillingGroupArn !== null) {
2854
+ if (data.BillingGroupArn != null) {
2926
2855
  contents.BillingGroupArn = __expectString(data.BillingGroupArn);
2927
2856
  }
2928
- if (data.ChargeDetails !== undefined && data.ChargeDetails !== null) {
2857
+ if (data.ChargeDetails != null) {
2929
2858
  contents.ChargeDetails = deserializeAws_restJson1ListCustomLineItemChargeDetails(data.ChargeDetails, context);
2930
2859
  }
2931
- if (data.Description !== undefined && data.Description !== null) {
2860
+ if (data.Description != null) {
2932
2861
  contents.Description = __expectString(data.Description);
2933
2862
  }
2934
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2863
+ if (data.LastModifiedTime != null) {
2935
2864
  contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2936
2865
  }
2937
- if (data.Name !== undefined && data.Name !== null) {
2866
+ if (data.Name != null) {
2938
2867
  contents.Name = __expectString(data.Name);
2939
2868
  }
2940
- return [2, Promise.resolve(contents)];
2869
+ return [2, contents];
2941
2870
  }
2942
2871
  });
2943
2872
  }); };
2944
2873
  var deserializeAws_restJson1UpdateCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2945
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2874
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2946
2875
  var _c;
2947
2876
  return __generator(this, function (_d) {
2948
2877
  switch (_d.label) {
@@ -2979,14 +2908,14 @@ var deserializeAws_restJson1UpdateCustomLineItemCommandError = function (output,
2979
2908
  case 11: throw _d.sent();
2980
2909
  case 12:
2981
2910
  parsedBody = parsedOutput.body;
2982
- $metadata = deserializeMetadata(output);
2983
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2984
- response = new __BaseException({
2985
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2986
- $fault: "client",
2987
- $metadata: $metadata,
2911
+ throwDefaultError({
2912
+ output: output,
2913
+ parsedBody: parsedBody,
2914
+ exceptionCtor: __BaseException,
2915
+ errorCode: errorCode,
2988
2916
  });
2989
- throw __decorateServiceException(response, parsedBody);
2917
+ _d.label = 13;
2918
+ case 13: return [2];
2990
2919
  }
2991
2920
  });
2992
2921
  }); };
@@ -2998,40 +2927,35 @@ export var deserializeAws_restJson1UpdatePricingPlanCommand = function (output,
2998
2927
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2999
2928
  return [2, deserializeAws_restJson1UpdatePricingPlanCommandError(output, context)];
3000
2929
  }
3001
- contents = {
2930
+ contents = map({
3002
2931
  $metadata: deserializeMetadata(output),
3003
- Arn: undefined,
3004
- Description: undefined,
3005
- LastModifiedTime: undefined,
3006
- Name: undefined,
3007
- Size: undefined,
3008
- };
2932
+ });
3009
2933
  _a = __expectNonNull;
3010
2934
  _b = __expectObject;
3011
2935
  return [4, parseBody(output.body, context)];
3012
2936
  case 1:
3013
2937
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3014
- if (data.Arn !== undefined && data.Arn !== null) {
2938
+ if (data.Arn != null) {
3015
2939
  contents.Arn = __expectString(data.Arn);
3016
2940
  }
3017
- if (data.Description !== undefined && data.Description !== null) {
2941
+ if (data.Description != null) {
3018
2942
  contents.Description = __expectString(data.Description);
3019
2943
  }
3020
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2944
+ if (data.LastModifiedTime != null) {
3021
2945
  contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
3022
2946
  }
3023
- if (data.Name !== undefined && data.Name !== null) {
2947
+ if (data.Name != null) {
3024
2948
  contents.Name = __expectString(data.Name);
3025
2949
  }
3026
- if (data.Size !== undefined && data.Size !== null) {
2950
+ if (data.Size != null) {
3027
2951
  contents.Size = __expectLong(data.Size);
3028
2952
  }
3029
- return [2, Promise.resolve(contents)];
2953
+ return [2, contents];
3030
2954
  }
3031
2955
  });
3032
2956
  }); };
3033
2957
  var deserializeAws_restJson1UpdatePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3034
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2958
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3035
2959
  var _c;
3036
2960
  return __generator(this, function (_d) {
3037
2961
  switch (_d.label) {
@@ -3072,14 +2996,14 @@ var deserializeAws_restJson1UpdatePricingPlanCommandError = function (output, co
3072
2996
  case 13: throw _d.sent();
3073
2997
  case 14:
3074
2998
  parsedBody = parsedOutput.body;
3075
- $metadata = deserializeMetadata(output);
3076
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3077
- response = new __BaseException({
3078
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3079
- $fault: "client",
3080
- $metadata: $metadata,
2999
+ throwDefaultError({
3000
+ output: output,
3001
+ parsedBody: parsedBody,
3002
+ exceptionCtor: __BaseException,
3003
+ errorCode: errorCode,
3081
3004
  });
3082
- throw __decorateServiceException(response, parsedBody);
3005
+ _d.label = 15;
3006
+ case 15: return [2];
3083
3007
  }
3084
3008
  });
3085
3009
  }); };
@@ -3091,56 +3015,47 @@ export var deserializeAws_restJson1UpdatePricingRuleCommand = function (output,
3091
3015
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3092
3016
  return [2, deserializeAws_restJson1UpdatePricingRuleCommandError(output, context)];
3093
3017
  }
3094
- contents = {
3018
+ contents = map({
3095
3019
  $metadata: deserializeMetadata(output),
3096
- Arn: undefined,
3097
- AssociatedPricingPlanCount: undefined,
3098
- Description: undefined,
3099
- LastModifiedTime: undefined,
3100
- ModifierPercentage: undefined,
3101
- Name: undefined,
3102
- Scope: undefined,
3103
- Service: undefined,
3104
- Type: undefined,
3105
- };
3020
+ });
3106
3021
  _a = __expectNonNull;
3107
3022
  _b = __expectObject;
3108
3023
  return [4, parseBody(output.body, context)];
3109
3024
  case 1:
3110
3025
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3111
- if (data.Arn !== undefined && data.Arn !== null) {
3026
+ if (data.Arn != null) {
3112
3027
  contents.Arn = __expectString(data.Arn);
3113
3028
  }
3114
- if (data.AssociatedPricingPlanCount !== undefined && data.AssociatedPricingPlanCount !== null) {
3029
+ if (data.AssociatedPricingPlanCount != null) {
3115
3030
  contents.AssociatedPricingPlanCount = __expectLong(data.AssociatedPricingPlanCount);
3116
3031
  }
3117
- if (data.Description !== undefined && data.Description !== null) {
3032
+ if (data.Description != null) {
3118
3033
  contents.Description = __expectString(data.Description);
3119
3034
  }
3120
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3035
+ if (data.LastModifiedTime != null) {
3121
3036
  contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
3122
3037
  }
3123
- if (data.ModifierPercentage !== undefined && data.ModifierPercentage !== null) {
3038
+ if (data.ModifierPercentage != null) {
3124
3039
  contents.ModifierPercentage = __limitedParseDouble(data.ModifierPercentage);
3125
3040
  }
3126
- if (data.Name !== undefined && data.Name !== null) {
3041
+ if (data.Name != null) {
3127
3042
  contents.Name = __expectString(data.Name);
3128
3043
  }
3129
- if (data.Scope !== undefined && data.Scope !== null) {
3044
+ if (data.Scope != null) {
3130
3045
  contents.Scope = __expectString(data.Scope);
3131
3046
  }
3132
- if (data.Service !== undefined && data.Service !== null) {
3047
+ if (data.Service != null) {
3133
3048
  contents.Service = __expectString(data.Service);
3134
3049
  }
3135
- if (data.Type !== undefined && data.Type !== null) {
3050
+ if (data.Type != null) {
3136
3051
  contents.Type = __expectString(data.Type);
3137
3052
  }
3138
- return [2, Promise.resolve(contents)];
3053
+ return [2, contents];
3139
3054
  }
3140
3055
  });
3141
3056
  }); };
3142
3057
  var deserializeAws_restJson1UpdatePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3143
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3058
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3144
3059
  var _c;
3145
3060
  return __generator(this, function (_d) {
3146
3061
  switch (_d.label) {
@@ -3181,23 +3096,24 @@ var deserializeAws_restJson1UpdatePricingRuleCommandError = function (output, co
3181
3096
  case 13: throw _d.sent();
3182
3097
  case 14:
3183
3098
  parsedBody = parsedOutput.body;
3184
- $metadata = deserializeMetadata(output);
3185
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3186
- response = new __BaseException({
3187
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3188
- $fault: "client",
3189
- $metadata: $metadata,
3099
+ throwDefaultError({
3100
+ output: output,
3101
+ parsedBody: parsedBody,
3102
+ exceptionCtor: __BaseException,
3103
+ errorCode: errorCode,
3190
3104
  });
3191
- throw __decorateServiceException(response, parsedBody);
3105
+ _d.label = 15;
3106
+ case 15: return [2];
3192
3107
  }
3193
3108
  });
3194
3109
  }); };
3110
+ var map = __map;
3195
3111
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3196
3112
  var contents, data, exception;
3197
3113
  return __generator(this, function (_a) {
3198
- contents = {};
3114
+ contents = map({});
3199
3115
  data = parsedOutput.body;
3200
- if (data.Message !== undefined && data.Message !== null) {
3116
+ if (data.Message != null) {
3201
3117
  contents.Message = __expectString(data.Message);
3202
3118
  }
3203
3119
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3207,15 +3123,15 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3207
3123
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3208
3124
  var contents, data, exception;
3209
3125
  return __generator(this, function (_a) {
3210
- contents = {};
3126
+ contents = map({});
3211
3127
  data = parsedOutput.body;
3212
- if (data.Message !== undefined && data.Message !== null) {
3128
+ if (data.Message != null) {
3213
3129
  contents.Message = __expectString(data.Message);
3214
3130
  }
3215
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3131
+ if (data.ResourceId != null) {
3216
3132
  contents.ResourceId = __expectString(data.ResourceId);
3217
3133
  }
3218
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3134
+ if (data.ResourceType != null) {
3219
3135
  contents.ResourceType = __expectString(data.ResourceType);
3220
3136
  }
3221
3137
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3225,12 +3141,14 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3225
3141
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3226
3142
  var contents, data, exception;
3227
3143
  return __generator(this, function (_a) {
3228
- contents = {};
3229
- if (parsedOutput.headers["retry-after"] !== undefined) {
3230
- contents.RetryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
3231
- }
3144
+ contents = map({
3145
+ RetryAfterSeconds: [
3146
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
3147
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
3148
+ ],
3149
+ });
3232
3150
  data = parsedOutput.body;
3233
- if (data.Message !== undefined && data.Message !== null) {
3151
+ if (data.Message != null) {
3234
3152
  contents.Message = __expectString(data.Message);
3235
3153
  }
3236
3154
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3240,15 +3158,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
3240
3158
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3241
3159
  var contents, data, exception;
3242
3160
  return __generator(this, function (_a) {
3243
- contents = {};
3161
+ contents = map({});
3244
3162
  data = parsedOutput.body;
3245
- if (data.Message !== undefined && data.Message !== null) {
3163
+ if (data.Message != null) {
3246
3164
  contents.Message = __expectString(data.Message);
3247
3165
  }
3248
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3166
+ if (data.ResourceId != null) {
3249
3167
  contents.ResourceId = __expectString(data.ResourceId);
3250
3168
  }
3251
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3169
+ if (data.ResourceType != null) {
3252
3170
  contents.ResourceType = __expectString(data.ResourceType);
3253
3171
  }
3254
3172
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3258,21 +3176,21 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3258
3176
  var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3259
3177
  var contents, data, exception;
3260
3178
  return __generator(this, function (_a) {
3261
- contents = {};
3179
+ contents = map({});
3262
3180
  data = parsedOutput.body;
3263
- if (data.LimitCode !== undefined && data.LimitCode !== null) {
3181
+ if (data.LimitCode != null) {
3264
3182
  contents.LimitCode = __expectString(data.LimitCode);
3265
3183
  }
3266
- if (data.Message !== undefined && data.Message !== null) {
3184
+ if (data.Message != null) {
3267
3185
  contents.Message = __expectString(data.Message);
3268
3186
  }
3269
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3187
+ if (data.ResourceId != null) {
3270
3188
  contents.ResourceId = __expectString(data.ResourceId);
3271
3189
  }
3272
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3190
+ if (data.ResourceType != null) {
3273
3191
  contents.ResourceType = __expectString(data.ResourceType);
3274
3192
  }
3275
- if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
3193
+ if (data.ServiceCode != null) {
3276
3194
  contents.ServiceCode = __expectString(data.ServiceCode);
3277
3195
  }
3278
3196
  exception = new ServiceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3282,12 +3200,14 @@ var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (pa
3282
3200
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3283
3201
  var contents, data, exception;
3284
3202
  return __generator(this, function (_a) {
3285
- contents = {};
3286
- if (parsedOutput.headers["retry-after"] !== undefined) {
3287
- contents.RetryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
3288
- }
3203
+ contents = map({
3204
+ RetryAfterSeconds: [
3205
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
3206
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
3207
+ ],
3208
+ });
3289
3209
  data = parsedOutput.body;
3290
- if (data.Message !== undefined && data.Message !== null) {
3210
+ if (data.Message != null) {
3291
3211
  contents.Message = __expectString(data.Message);
3292
3212
  }
3293
3213
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3297,15 +3217,15 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
3297
3217
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3298
3218
  var contents, data, exception;
3299
3219
  return __generator(this, function (_a) {
3300
- contents = {};
3220
+ contents = map({});
3301
3221
  data = parsedOutput.body;
3302
- if (data.Fields !== undefined && data.Fields !== null) {
3222
+ if (data.Fields != null) {
3303
3223
  contents.Fields = deserializeAws_restJson1ValidationExceptionFieldList(data.Fields, context);
3304
3224
  }
3305
- if (data.Message !== undefined && data.Message !== null) {
3225
+ if (data.Message != null) {
3306
3226
  contents.Message = __expectString(data.Message);
3307
3227
  }
3308
- if (data.Reason !== undefined && data.Reason !== null) {
3228
+ if (data.Reason != null) {
3309
3229
  contents.Reason = __expectString(data.Reason);
3310
3230
  }
3311
3231
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3321,9 +3241,6 @@ var serializeAws_restJson1AccountIdList = function (input, context) {
3321
3241
  return input
3322
3242
  .filter(function (e) { return e != null; })
3323
3243
  .map(function (entry) {
3324
- if (entry === null) {
3325
- return null;
3326
- }
3327
3244
  return entry;
3328
3245
  });
3329
3246
  };
@@ -3331,9 +3248,6 @@ var serializeAws_restJson1BillingGroupArnList = function (input, context) {
3331
3248
  return input
3332
3249
  .filter(function (e) { return e != null; })
3333
3250
  .map(function (entry) {
3334
- if (entry === null) {
3335
- return null;
3336
- }
3337
3251
  return entry;
3338
3252
  });
3339
3253
  };
@@ -3344,9 +3258,6 @@ var serializeAws_restJson1CustomLineItemArns = function (input, context) {
3344
3258
  return input
3345
3259
  .filter(function (e) { return e != null; })
3346
3260
  .map(function (entry) {
3347
- if (entry === null) {
3348
- return null;
3349
- }
3350
3261
  return entry;
3351
3262
  });
3352
3263
  };
@@ -3354,9 +3265,6 @@ var serializeAws_restJson1CustomLineItemAssociationsList = function (input, cont
3354
3265
  return input
3355
3266
  .filter(function (e) { return e != null; })
3356
3267
  .map(function (entry) {
3357
- if (entry === null) {
3358
- return null;
3359
- }
3360
3268
  return entry;
3361
3269
  });
3362
3270
  };
@@ -3364,9 +3272,6 @@ var serializeAws_restJson1CustomLineItemBatchAssociationsList = function (input,
3364
3272
  return input
3365
3273
  .filter(function (e) { return e != null; })
3366
3274
  .map(function (entry) {
3367
- if (entry === null) {
3368
- return null;
3369
- }
3370
3275
  return entry;
3371
3276
  });
3372
3277
  };
@@ -3374,9 +3279,6 @@ var serializeAws_restJson1CustomLineItemBatchDisassociationsList = function (inp
3374
3279
  return input
3375
3280
  .filter(function (e) { return e != null; })
3376
3281
  .map(function (entry) {
3377
- if (entry === null) {
3378
- return null;
3379
- }
3380
3282
  return entry;
3381
3283
  });
3382
3284
  };
@@ -3397,9 +3299,6 @@ var serializeAws_restJson1CustomLineItemNameList = function (input, context) {
3397
3299
  return input
3398
3300
  .filter(function (e) { return e != null; })
3399
3301
  .map(function (entry) {
3400
- if (entry === null) {
3401
- return null;
3402
- }
3403
3302
  return entry;
3404
3303
  });
3405
3304
  };
@@ -3437,9 +3336,6 @@ var serializeAws_restJson1PricingPlanArns = function (input, context) {
3437
3336
  return input
3438
3337
  .filter(function (e) { return e != null; })
3439
3338
  .map(function (entry) {
3440
- if (entry === null) {
3441
- return null;
3442
- }
3443
3339
  return entry;
3444
3340
  });
3445
3341
  };
@@ -3447,9 +3343,6 @@ var serializeAws_restJson1PricingRuleArns = function (input, context) {
3447
3343
  return input
3448
3344
  .filter(function (e) { return e != null; })
3449
3345
  .map(function (entry) {
3450
- if (entry === null) {
3451
- return null;
3452
- }
3453
3346
  return entry;
3454
3347
  });
3455
3348
  };
@@ -3457,9 +3350,6 @@ var serializeAws_restJson1PricingRuleArnsInput = function (input, context) {
3457
3350
  return input
3458
3351
  .filter(function (e) { return e != null; })
3459
3352
  .map(function (entry) {
3460
- if (entry === null) {
3461
- return null;
3462
- }
3463
3353
  return entry;
3464
3354
  });
3465
3355
  };
@@ -3467,9 +3357,6 @@ var serializeAws_restJson1PricingRuleArnsNonEmptyInput = function (input, contex
3467
3357
  return input
3468
3358
  .filter(function (e) { return e != null; })
3469
3359
  .map(function (entry) {
3470
- if (entry === null) {
3471
- return null;
3472
- }
3473
3360
  return entry;
3474
3361
  });
3475
3362
  };