@aws-sdk/client-billingconductor 3.55.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 (220) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +215 -0
  4. package/dist-cjs/Billingconductor.js +457 -0
  5. package/dist-cjs/BillingconductorClient.js +35 -0
  6. package/dist-cjs/commands/AssociateAccountsCommand.js +36 -0
  7. package/dist-cjs/commands/AssociatePricingRulesCommand.js +36 -0
  8. package/dist-cjs/commands/BatchAssociateResourcesToCustomLineItemCommand.js +36 -0
  9. package/dist-cjs/commands/BatchDisassociateResourcesFromCustomLineItemCommand.js +36 -0
  10. package/dist-cjs/commands/CreateBillingGroupCommand.js +36 -0
  11. package/dist-cjs/commands/CreateCustomLineItemCommand.js +36 -0
  12. package/dist-cjs/commands/CreatePricingPlanCommand.js +36 -0
  13. package/dist-cjs/commands/CreatePricingRuleCommand.js +36 -0
  14. package/dist-cjs/commands/DeleteBillingGroupCommand.js +36 -0
  15. package/dist-cjs/commands/DeleteCustomLineItemCommand.js +36 -0
  16. package/dist-cjs/commands/DeletePricingPlanCommand.js +36 -0
  17. package/dist-cjs/commands/DeletePricingRuleCommand.js +36 -0
  18. package/dist-cjs/commands/DisassociateAccountsCommand.js +36 -0
  19. package/dist-cjs/commands/DisassociatePricingRulesCommand.js +36 -0
  20. package/dist-cjs/commands/ListAccountAssociationsCommand.js +36 -0
  21. package/dist-cjs/commands/ListBillingGroupCostReportsCommand.js +36 -0
  22. package/dist-cjs/commands/ListBillingGroupsCommand.js +36 -0
  23. package/dist-cjs/commands/ListCustomLineItemsCommand.js +36 -0
  24. package/dist-cjs/commands/ListPricingPlansAssociatedWithPricingRuleCommand.js +36 -0
  25. package/dist-cjs/commands/ListPricingPlansCommand.js +36 -0
  26. package/dist-cjs/commands/ListPricingRulesAssociatedToPricingPlanCommand.js +36 -0
  27. package/dist-cjs/commands/ListPricingRulesCommand.js +36 -0
  28. package/dist-cjs/commands/ListResourcesAssociatedToCustomLineItemCommand.js +36 -0
  29. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  30. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  31. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  32. package/dist-cjs/commands/UpdateBillingGroupCommand.js +36 -0
  33. package/dist-cjs/commands/UpdateCustomLineItemCommand.js +36 -0
  34. package/dist-cjs/commands/UpdatePricingPlanCommand.js +36 -0
  35. package/dist-cjs/commands/UpdatePricingRuleCommand.js +36 -0
  36. package/dist-cjs/commands/index.js +33 -0
  37. package/dist-cjs/endpoints.js +131 -0
  38. package/dist-cjs/index.js +11 -0
  39. package/dist-cjs/models/BillingconductorServiceException.js +11 -0
  40. package/dist-cjs/models/index.js +4 -0
  41. package/dist-cjs/models/models_0.js +792 -0
  42. package/dist-cjs/pagination/Interfaces.js +2 -0
  43. package/dist-cjs/pagination/ListAccountAssociationsPaginator.js +34 -0
  44. package/dist-cjs/pagination/ListBillingGroupCostReportsPaginator.js +35 -0
  45. package/dist-cjs/pagination/ListBillingGroupsPaginator.js +35 -0
  46. package/dist-cjs/pagination/ListCustomLineItemsPaginator.js +35 -0
  47. package/dist-cjs/pagination/ListPricingPlansAssociatedWithPricingRulePaginator.js +35 -0
  48. package/dist-cjs/pagination/ListPricingPlansPaginator.js +35 -0
  49. package/dist-cjs/pagination/ListPricingRulesAssociatedToPricingPlanPaginator.js +35 -0
  50. package/dist-cjs/pagination/ListPricingRulesPaginator.js +35 -0
  51. package/dist-cjs/pagination/ListResourcesAssociatedToCustomLineItemPaginator.js +35 -0
  52. package/dist-cjs/pagination/index.js +13 -0
  53. package/dist-cjs/protocols/Aws_restJson1.js +3178 -0
  54. package/dist-cjs/runtimeConfig.browser.js +45 -0
  55. package/dist-cjs/runtimeConfig.js +50 -0
  56. package/dist-cjs/runtimeConfig.native.js +16 -0
  57. package/dist-cjs/runtimeConfig.shared.js +17 -0
  58. package/dist-es/Billingconductor.js +460 -0
  59. package/dist-es/BillingconductorClient.js +37 -0
  60. package/dist-es/commands/AssociateAccountsCommand.js +39 -0
  61. package/dist-es/commands/AssociatePricingRulesCommand.js +39 -0
  62. package/dist-es/commands/BatchAssociateResourcesToCustomLineItemCommand.js +39 -0
  63. package/dist-es/commands/BatchDisassociateResourcesFromCustomLineItemCommand.js +39 -0
  64. package/dist-es/commands/CreateBillingGroupCommand.js +39 -0
  65. package/dist-es/commands/CreateCustomLineItemCommand.js +39 -0
  66. package/dist-es/commands/CreatePricingPlanCommand.js +39 -0
  67. package/dist-es/commands/CreatePricingRuleCommand.js +39 -0
  68. package/dist-es/commands/DeleteBillingGroupCommand.js +39 -0
  69. package/dist-es/commands/DeleteCustomLineItemCommand.js +39 -0
  70. package/dist-es/commands/DeletePricingPlanCommand.js +39 -0
  71. package/dist-es/commands/DeletePricingRuleCommand.js +39 -0
  72. package/dist-es/commands/DisassociateAccountsCommand.js +39 -0
  73. package/dist-es/commands/DisassociatePricingRulesCommand.js +39 -0
  74. package/dist-es/commands/ListAccountAssociationsCommand.js +39 -0
  75. package/dist-es/commands/ListBillingGroupCostReportsCommand.js +39 -0
  76. package/dist-es/commands/ListBillingGroupsCommand.js +39 -0
  77. package/dist-es/commands/ListCustomLineItemsCommand.js +39 -0
  78. package/dist-es/commands/ListPricingPlansAssociatedWithPricingRuleCommand.js +39 -0
  79. package/dist-es/commands/ListPricingPlansCommand.js +39 -0
  80. package/dist-es/commands/ListPricingRulesAssociatedToPricingPlanCommand.js +39 -0
  81. package/dist-es/commands/ListPricingRulesCommand.js +39 -0
  82. package/dist-es/commands/ListResourcesAssociatedToCustomLineItemCommand.js +39 -0
  83. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  84. package/dist-es/commands/TagResourceCommand.js +39 -0
  85. package/dist-es/commands/UntagResourceCommand.js +39 -0
  86. package/dist-es/commands/UpdateBillingGroupCommand.js +39 -0
  87. package/dist-es/commands/UpdateCustomLineItemCommand.js +39 -0
  88. package/dist-es/commands/UpdatePricingPlanCommand.js +39 -0
  89. package/dist-es/commands/UpdatePricingRuleCommand.js +39 -0
  90. package/dist-es/commands/index.js +30 -0
  91. package/dist-es/endpoints.js +127 -0
  92. package/dist-es/index.js +6 -0
  93. package/dist-es/models/BillingconductorServiceException.js +12 -0
  94. package/dist-es/models/index.js +1 -0
  95. package/dist-es/models/models_0.js +560 -0
  96. package/dist-es/pagination/Interfaces.js +1 -0
  97. package/dist-es/pagination/ListAccountAssociationsPaginator.js +73 -0
  98. package/dist-es/pagination/ListBillingGroupCostReportsPaginator.js +74 -0
  99. package/dist-es/pagination/ListBillingGroupsPaginator.js +74 -0
  100. package/dist-es/pagination/ListCustomLineItemsPaginator.js +74 -0
  101. package/dist-es/pagination/ListPricingPlansAssociatedWithPricingRulePaginator.js +74 -0
  102. package/dist-es/pagination/ListPricingPlansPaginator.js +74 -0
  103. package/dist-es/pagination/ListPricingRulesAssociatedToPricingPlanPaginator.js +74 -0
  104. package/dist-es/pagination/ListPricingRulesPaginator.js +74 -0
  105. package/dist-es/pagination/ListResourcesAssociatedToCustomLineItemPaginator.js +74 -0
  106. package/dist-es/pagination/index.js +10 -0
  107. package/dist-es/protocols/Aws_restJson1.js +3850 -0
  108. package/dist-es/runtimeConfig.browser.js +26 -0
  109. package/dist-es/runtimeConfig.js +28 -0
  110. package/dist-es/runtimeConfig.native.js +8 -0
  111. package/dist-es/runtimeConfig.shared.js +13 -0
  112. package/dist-types/Billingconductor.d.ts +283 -0
  113. package/dist-types/BillingconductorClient.d.ts +186 -0
  114. package/dist-types/commands/AssociateAccountsCommand.d.ts +38 -0
  115. package/dist-types/commands/AssociatePricingRulesCommand.d.ts +36 -0
  116. package/dist-types/commands/BatchAssociateResourcesToCustomLineItemCommand.d.ts +37 -0
  117. package/dist-types/commands/BatchDisassociateResourcesFromCustomLineItemCommand.d.ts +37 -0
  118. package/dist-types/commands/CreateBillingGroupCommand.d.ts +37 -0
  119. package/dist-types/commands/CreateCustomLineItemCommand.d.ts +37 -0
  120. package/dist-types/commands/CreatePricingPlanCommand.d.ts +36 -0
  121. package/dist-types/commands/CreatePricingRuleCommand.d.ts +37 -0
  122. package/dist-types/commands/DeleteBillingGroupCommand.d.ts +37 -0
  123. package/dist-types/commands/DeleteCustomLineItemCommand.d.ts +37 -0
  124. package/dist-types/commands/DeletePricingPlanCommand.d.ts +36 -0
  125. package/dist-types/commands/DeletePricingRuleCommand.d.ts +35 -0
  126. package/dist-types/commands/DisassociateAccountsCommand.d.ts +35 -0
  127. package/dist-types/commands/DisassociatePricingRulesCommand.d.ts +37 -0
  128. package/dist-types/commands/ListAccountAssociationsCommand.d.ts +43 -0
  129. package/dist-types/commands/ListBillingGroupCostReportsCommand.d.ts +36 -0
  130. package/dist-types/commands/ListBillingGroupsCommand.d.ts +35 -0
  131. package/dist-types/commands/ListCustomLineItemsCommand.d.ts +37 -0
  132. package/dist-types/commands/ListPricingPlansAssociatedWithPricingRuleCommand.d.ts +37 -0
  133. package/dist-types/commands/ListPricingPlansCommand.d.ts +36 -0
  134. package/dist-types/commands/ListPricingRulesAssociatedToPricingPlanCommand.d.ts +37 -0
  135. package/dist-types/commands/ListPricingRulesCommand.d.ts +37 -0
  136. package/dist-types/commands/ListResourcesAssociatedToCustomLineItemCommand.d.ts +37 -0
  137. package/dist-types/commands/ListTagsForResourceCommand.d.ts +37 -0
  138. package/dist-types/commands/TagResourceCommand.d.ts +37 -0
  139. package/dist-types/commands/UntagResourceCommand.d.ts +37 -0
  140. package/dist-types/commands/UpdateBillingGroupCommand.d.ts +36 -0
  141. package/dist-types/commands/UpdateCustomLineItemCommand.d.ts +37 -0
  142. package/dist-types/commands/UpdatePricingPlanCommand.d.ts +36 -0
  143. package/dist-types/commands/UpdatePricingRuleCommand.d.ts +37 -0
  144. package/dist-types/commands/index.d.ts +30 -0
  145. package/dist-types/endpoints.d.ts +2 -0
  146. package/dist-types/index.d.ts +6 -0
  147. package/dist-types/models/BillingconductorServiceException.d.ts +10 -0
  148. package/dist-types/models/index.d.ts +1 -0
  149. package/dist-types/models/models_0.d.ts +2576 -0
  150. package/dist-types/pagination/Interfaces.d.ts +6 -0
  151. package/dist-types/pagination/ListAccountAssociationsPaginator.d.ts +4 -0
  152. package/dist-types/pagination/ListBillingGroupCostReportsPaginator.d.ts +4 -0
  153. package/dist-types/pagination/ListBillingGroupsPaginator.d.ts +4 -0
  154. package/dist-types/pagination/ListCustomLineItemsPaginator.d.ts +4 -0
  155. package/dist-types/pagination/ListPricingPlansAssociatedWithPricingRulePaginator.d.ts +4 -0
  156. package/dist-types/pagination/ListPricingPlansPaginator.d.ts +4 -0
  157. package/dist-types/pagination/ListPricingRulesAssociatedToPricingPlanPaginator.d.ts +4 -0
  158. package/dist-types/pagination/ListPricingRulesPaginator.d.ts +4 -0
  159. package/dist-types/pagination/ListResourcesAssociatedToCustomLineItemPaginator.d.ts +4 -0
  160. package/dist-types/pagination/index.d.ts +10 -0
  161. package/dist-types/protocols/Aws_restJson1.d.ts +92 -0
  162. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  163. package/dist-types/runtimeConfig.d.ts +40 -0
  164. package/dist-types/runtimeConfig.native.d.ts +39 -0
  165. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  166. package/dist-types/ts3.4/Billingconductor.d.ts +155 -0
  167. package/dist-types/ts3.4/BillingconductorClient.d.ts +103 -0
  168. package/dist-types/ts3.4/commands/AssociateAccountsCommand.d.ts +17 -0
  169. package/dist-types/ts3.4/commands/AssociatePricingRulesCommand.d.ts +17 -0
  170. package/dist-types/ts3.4/commands/BatchAssociateResourcesToCustomLineItemCommand.d.ts +17 -0
  171. package/dist-types/ts3.4/commands/BatchDisassociateResourcesFromCustomLineItemCommand.d.ts +17 -0
  172. package/dist-types/ts3.4/commands/CreateBillingGroupCommand.d.ts +17 -0
  173. package/dist-types/ts3.4/commands/CreateCustomLineItemCommand.d.ts +17 -0
  174. package/dist-types/ts3.4/commands/CreatePricingPlanCommand.d.ts +17 -0
  175. package/dist-types/ts3.4/commands/CreatePricingRuleCommand.d.ts +17 -0
  176. package/dist-types/ts3.4/commands/DeleteBillingGroupCommand.d.ts +17 -0
  177. package/dist-types/ts3.4/commands/DeleteCustomLineItemCommand.d.ts +17 -0
  178. package/dist-types/ts3.4/commands/DeletePricingPlanCommand.d.ts +17 -0
  179. package/dist-types/ts3.4/commands/DeletePricingRuleCommand.d.ts +17 -0
  180. package/dist-types/ts3.4/commands/DisassociateAccountsCommand.d.ts +17 -0
  181. package/dist-types/ts3.4/commands/DisassociatePricingRulesCommand.d.ts +17 -0
  182. package/dist-types/ts3.4/commands/ListAccountAssociationsCommand.d.ts +17 -0
  183. package/dist-types/ts3.4/commands/ListBillingGroupCostReportsCommand.d.ts +17 -0
  184. package/dist-types/ts3.4/commands/ListBillingGroupsCommand.d.ts +17 -0
  185. package/dist-types/ts3.4/commands/ListCustomLineItemsCommand.d.ts +17 -0
  186. package/dist-types/ts3.4/commands/ListPricingPlansAssociatedWithPricingRuleCommand.d.ts +17 -0
  187. package/dist-types/ts3.4/commands/ListPricingPlansCommand.d.ts +17 -0
  188. package/dist-types/ts3.4/commands/ListPricingRulesAssociatedToPricingPlanCommand.d.ts +17 -0
  189. package/dist-types/ts3.4/commands/ListPricingRulesCommand.d.ts +17 -0
  190. package/dist-types/ts3.4/commands/ListResourcesAssociatedToCustomLineItemCommand.d.ts +17 -0
  191. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  192. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  193. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  194. package/dist-types/ts3.4/commands/UpdateBillingGroupCommand.d.ts +17 -0
  195. package/dist-types/ts3.4/commands/UpdateCustomLineItemCommand.d.ts +17 -0
  196. package/dist-types/ts3.4/commands/UpdatePricingPlanCommand.d.ts +17 -0
  197. package/dist-types/ts3.4/commands/UpdatePricingRuleCommand.d.ts +17 -0
  198. package/dist-types/ts3.4/commands/index.d.ts +30 -0
  199. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  200. package/dist-types/ts3.4/index.d.ts +6 -0
  201. package/dist-types/ts3.4/models/BillingconductorServiceException.d.ts +6 -0
  202. package/dist-types/ts3.4/models/index.d.ts +1 -0
  203. package/dist-types/ts3.4/models/models_0.d.ts +1266 -0
  204. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  205. package/dist-types/ts3.4/pagination/ListAccountAssociationsPaginator.d.ts +4 -0
  206. package/dist-types/ts3.4/pagination/ListBillingGroupCostReportsPaginator.d.ts +4 -0
  207. package/dist-types/ts3.4/pagination/ListBillingGroupsPaginator.d.ts +4 -0
  208. package/dist-types/ts3.4/pagination/ListCustomLineItemsPaginator.d.ts +4 -0
  209. package/dist-types/ts3.4/pagination/ListPricingPlansAssociatedWithPricingRulePaginator.d.ts +4 -0
  210. package/dist-types/ts3.4/pagination/ListPricingPlansPaginator.d.ts +4 -0
  211. package/dist-types/ts3.4/pagination/ListPricingRulesAssociatedToPricingPlanPaginator.d.ts +4 -0
  212. package/dist-types/ts3.4/pagination/ListPricingRulesPaginator.d.ts +4 -0
  213. package/dist-types/ts3.4/pagination/ListResourcesAssociatedToCustomLineItemPaginator.d.ts +4 -0
  214. package/dist-types/ts3.4/pagination/index.d.ts +10 -0
  215. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +92 -0
  216. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  217. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  218. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  219. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  220. package/package.json +95 -0
@@ -0,0 +1,3850 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
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";
4
+ import { BillingconductorServiceException as __BaseException } from "../models/BillingconductorServiceException";
5
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
+ export var serializeAws_restJson1AssociateAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associate-accounts";
17
+ body = JSON.stringify(__assign(__assign({}, (input.AccountIds !== undefined &&
18
+ input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) })), (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })));
19
+ return [2, new __HttpRequest({
20
+ protocol: protocol,
21
+ hostname: hostname,
22
+ port: port,
23
+ method: "POST",
24
+ headers: headers,
25
+ path: resolvedPath,
26
+ body: body,
27
+ })];
28
+ }
29
+ });
30
+ }); };
31
+ export var serializeAws_restJson1AssociatePricingRulesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
32
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
33
+ return __generator(this, function (_c) {
34
+ switch (_c.label) {
35
+ case 0: return [4, context.endpoint()];
36
+ case 1:
37
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
38
+ headers = {
39
+ "content-type": "application/json",
40
+ };
41
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/associate-pricing-rules";
42
+ body = JSON.stringify(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.PricingRuleArns !== undefined &&
43
+ input.PricingRuleArns !== null && {
44
+ PricingRuleArns: serializeAws_restJson1PricingRuleArnsNonEmptyInput(input.PricingRuleArns, context),
45
+ })));
46
+ return [2, new __HttpRequest({
47
+ protocol: protocol,
48
+ hostname: hostname,
49
+ port: port,
50
+ method: "PUT",
51
+ headers: headers,
52
+ path: resolvedPath,
53
+ body: body,
54
+ })];
55
+ }
56
+ });
57
+ }); };
58
+ export var serializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
59
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
60
+ return __generator(this, function (_c) {
61
+ switch (_c.label) {
62
+ case 0: return [4, context.endpoint()];
63
+ case 1:
64
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
65
+ headers = {
66
+ "content-type": "application/json",
67
+ };
68
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
69
+ "/batch-associate-resources-to-custom-line-item";
70
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.BillingPeriodRange !== undefined &&
71
+ input.BillingPeriodRange !== null && {
72
+ BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
73
+ })), (input.ResourceArns !== undefined &&
74
+ input.ResourceArns !== null && {
75
+ ResourceArns: serializeAws_restJson1CustomLineItemBatchAssociationsList(input.ResourceArns, context),
76
+ })), (input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn })));
77
+ return [2, new __HttpRequest({
78
+ protocol: protocol,
79
+ hostname: hostname,
80
+ port: port,
81
+ method: "PUT",
82
+ headers: headers,
83
+ path: resolvedPath,
84
+ body: body,
85
+ })];
86
+ }
87
+ });
88
+ }); };
89
+ export var serializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
90
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
91
+ return __generator(this, function (_c) {
92
+ switch (_c.label) {
93
+ case 0: return [4, context.endpoint()];
94
+ case 1:
95
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
96
+ headers = {
97
+ "content-type": "application/json",
98
+ };
99
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
100
+ "/batch-disassociate-resources-from-custom-line-item";
101
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.BillingPeriodRange !== undefined &&
102
+ input.BillingPeriodRange !== null && {
103
+ BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
104
+ })), (input.ResourceArns !== undefined &&
105
+ input.ResourceArns !== null && {
106
+ ResourceArns: serializeAws_restJson1CustomLineItemBatchDisassociationsList(input.ResourceArns, context),
107
+ })), (input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn })));
108
+ return [2, new __HttpRequest({
109
+ protocol: protocol,
110
+ hostname: hostname,
111
+ port: port,
112
+ method: "PUT",
113
+ headers: headers,
114
+ path: resolvedPath,
115
+ body: body,
116
+ })];
117
+ }
118
+ });
119
+ }); };
120
+ export var serializeAws_restJson1CreateBillingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
121
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
122
+ return __generator(this, function (_c) {
123
+ switch (_c.label) {
124
+ case 0: return [4, context.endpoint()];
125
+ case 1:
126
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
127
+ headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
128
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-billing-group";
129
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AccountGrouping !== undefined &&
130
+ input.AccountGrouping !== null && {
131
+ AccountGrouping: serializeAws_restJson1AccountGrouping(input.AccountGrouping, context),
132
+ })), (input.ComputationPreference !== undefined &&
133
+ input.ComputationPreference !== null && {
134
+ ComputationPreference: serializeAws_restJson1ComputationPreference(input.ComputationPreference, context),
135
+ })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.PrimaryAccountId !== undefined &&
136
+ input.PrimaryAccountId !== null && { PrimaryAccountId: input.PrimaryAccountId })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
137
+ return [2, new __HttpRequest({
138
+ protocol: protocol,
139
+ hostname: hostname,
140
+ port: port,
141
+ method: "POST",
142
+ headers: headers,
143
+ path: resolvedPath,
144
+ body: body,
145
+ })];
146
+ }
147
+ });
148
+ }); };
149
+ export var serializeAws_restJson1CreateCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
150
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
151
+ return __generator(this, function (_c) {
152
+ switch (_c.label) {
153
+ case 0: return [4, context.endpoint()];
154
+ case 1:
155
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
156
+ headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
157
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-custom-line-item";
158
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.BillingGroupArn !== undefined &&
159
+ input.BillingGroupArn !== null && { BillingGroupArn: input.BillingGroupArn })), (input.BillingPeriodRange !== undefined &&
160
+ input.BillingPeriodRange !== null && {
161
+ BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
162
+ })), (input.ChargeDetails !== undefined &&
163
+ input.ChargeDetails !== null && {
164
+ ChargeDetails: serializeAws_restJson1CustomLineItemChargeDetails(input.ChargeDetails, context),
165
+ })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
166
+ return [2, new __HttpRequest({
167
+ protocol: protocol,
168
+ hostname: hostname,
169
+ port: port,
170
+ method: "POST",
171
+ headers: headers,
172
+ path: resolvedPath,
173
+ body: body,
174
+ })];
175
+ }
176
+ });
177
+ }); };
178
+ export var serializeAws_restJson1CreatePricingPlanCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
179
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
180
+ return __generator(this, function (_c) {
181
+ switch (_c.label) {
182
+ case 0: return [4, context.endpoint()];
183
+ case 1:
184
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
185
+ headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
186
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-pricing-plan";
187
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.PricingRuleArns !== undefined &&
188
+ input.PricingRuleArns !== null && {
189
+ PricingRuleArns: serializeAws_restJson1PricingRuleArnsInput(input.PricingRuleArns, context),
190
+ })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
191
+ return [2, new __HttpRequest({
192
+ protocol: protocol,
193
+ hostname: hostname,
194
+ port: port,
195
+ method: "POST",
196
+ headers: headers,
197
+ path: resolvedPath,
198
+ body: body,
199
+ })];
200
+ }
201
+ });
202
+ }); };
203
+ export var serializeAws_restJson1CreatePricingRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
204
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
205
+ return __generator(this, function (_c) {
206
+ switch (_c.label) {
207
+ case 0: return [4, context.endpoint()];
208
+ case 1:
209
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
210
+ headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.ClientToken) && { "x-amzn-client-token": input.ClientToken }));
211
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/create-pricing-rule";
212
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.ModifierPercentage !== undefined &&
213
+ input.ModifierPercentage !== null && { ModifierPercentage: __serializeFloat(input.ModifierPercentage) })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope })), (input.Service !== undefined && input.Service !== null && { Service: input.Service })), (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.Type !== undefined && input.Type !== null && { Type: input.Type })));
214
+ return [2, new __HttpRequest({
215
+ protocol: protocol,
216
+ hostname: hostname,
217
+ port: port,
218
+ method: "POST",
219
+ headers: headers,
220
+ path: resolvedPath,
221
+ body: body,
222
+ })];
223
+ }
224
+ });
225
+ }); };
226
+ export var serializeAws_restJson1DeleteBillingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
227
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
228
+ return __generator(this, function (_c) {
229
+ switch (_c.label) {
230
+ case 0: return [4, context.endpoint()];
231
+ case 1:
232
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
233
+ headers = {
234
+ "content-type": "application/json",
235
+ };
236
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/delete-billing-group";
237
+ body = JSON.stringify(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })));
238
+ return [2, new __HttpRequest({
239
+ protocol: protocol,
240
+ hostname: hostname,
241
+ port: port,
242
+ method: "POST",
243
+ headers: headers,
244
+ path: resolvedPath,
245
+ body: body,
246
+ })];
247
+ }
248
+ });
249
+ }); };
250
+ export var serializeAws_restJson1DeleteCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
251
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
252
+ return __generator(this, function (_c) {
253
+ switch (_c.label) {
254
+ case 0: return [4, context.endpoint()];
255
+ case 1:
256
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
257
+ headers = {
258
+ "content-type": "application/json",
259
+ };
260
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/delete-custom-line-item";
261
+ body = JSON.stringify(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.BillingPeriodRange !== undefined &&
262
+ input.BillingPeriodRange !== null && {
263
+ BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
264
+ })));
265
+ return [2, new __HttpRequest({
266
+ protocol: protocol,
267
+ hostname: hostname,
268
+ port: port,
269
+ method: "POST",
270
+ headers: headers,
271
+ path: resolvedPath,
272
+ body: body,
273
+ })];
274
+ }
275
+ });
276
+ }); };
277
+ export var serializeAws_restJson1DeletePricingPlanCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
278
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
279
+ return __generator(this, function (_c) {
280
+ switch (_c.label) {
281
+ case 0: return [4, context.endpoint()];
282
+ case 1:
283
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
284
+ headers = {
285
+ "content-type": "application/json",
286
+ };
287
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/delete-pricing-plan";
288
+ body = JSON.stringify(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })));
289
+ return [2, new __HttpRequest({
290
+ protocol: protocol,
291
+ hostname: hostname,
292
+ port: port,
293
+ method: "POST",
294
+ headers: headers,
295
+ path: resolvedPath,
296
+ body: body,
297
+ })];
298
+ }
299
+ });
300
+ }); };
301
+ export var serializeAws_restJson1DeletePricingRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
302
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
303
+ return __generator(this, function (_c) {
304
+ switch (_c.label) {
305
+ case 0: return [4, context.endpoint()];
306
+ case 1:
307
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
308
+ headers = {
309
+ "content-type": "application/json",
310
+ };
311
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/delete-pricing-rule";
312
+ body = JSON.stringify(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })));
313
+ return [2, new __HttpRequest({
314
+ protocol: protocol,
315
+ hostname: hostname,
316
+ port: port,
317
+ method: "POST",
318
+ headers: headers,
319
+ path: resolvedPath,
320
+ body: body,
321
+ })];
322
+ }
323
+ });
324
+ }); };
325
+ export var serializeAws_restJson1DisassociateAccountsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
326
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
327
+ return __generator(this, function (_c) {
328
+ switch (_c.label) {
329
+ case 0: return [4, context.endpoint()];
330
+ case 1:
331
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
332
+ headers = {
333
+ "content-type": "application/json",
334
+ };
335
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/disassociate-accounts";
336
+ body = JSON.stringify(__assign(__assign({}, (input.AccountIds !== undefined &&
337
+ input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) })), (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })));
338
+ return [2, new __HttpRequest({
339
+ protocol: protocol,
340
+ hostname: hostname,
341
+ port: port,
342
+ method: "POST",
343
+ headers: headers,
344
+ path: resolvedPath,
345
+ body: body,
346
+ })];
347
+ }
348
+ });
349
+ }); };
350
+ export var serializeAws_restJson1DisassociatePricingRulesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
351
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
352
+ return __generator(this, function (_c) {
353
+ switch (_c.label) {
354
+ case 0: return [4, context.endpoint()];
355
+ case 1:
356
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
357
+ headers = {
358
+ "content-type": "application/json",
359
+ };
360
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/disassociate-pricing-rules";
361
+ body = JSON.stringify(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.PricingRuleArns !== undefined &&
362
+ input.PricingRuleArns !== null && {
363
+ PricingRuleArns: serializeAws_restJson1PricingRuleArnsNonEmptyInput(input.PricingRuleArns, context),
364
+ })));
365
+ return [2, new __HttpRequest({
366
+ protocol: protocol,
367
+ hostname: hostname,
368
+ port: port,
369
+ method: "PUT",
370
+ headers: headers,
371
+ path: resolvedPath,
372
+ body: body,
373
+ })];
374
+ }
375
+ });
376
+ }); };
377
+ export var serializeAws_restJson1ListAccountAssociationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
378
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
379
+ return __generator(this, function (_c) {
380
+ switch (_c.label) {
381
+ case 0: return [4, context.endpoint()];
382
+ case 1:
383
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
384
+ headers = {
385
+ "content-type": "application/json",
386
+ };
387
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-account-associations";
388
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
389
+ input.Filters !== null && {
390
+ Filters: serializeAws_restJson1ListAccountAssociationsFilter(input.Filters, context),
391
+ })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
392
+ return [2, new __HttpRequest({
393
+ protocol: protocol,
394
+ hostname: hostname,
395
+ port: port,
396
+ method: "POST",
397
+ headers: headers,
398
+ path: resolvedPath,
399
+ body: body,
400
+ })];
401
+ }
402
+ });
403
+ }); };
404
+ export var serializeAws_restJson1ListBillingGroupCostReportsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
405
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
406
+ return __generator(this, function (_c) {
407
+ switch (_c.label) {
408
+ case 0: return [4, context.endpoint()];
409
+ case 1:
410
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
411
+ headers = {
412
+ "content-type": "application/json",
413
+ };
414
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-billing-group-cost-reports";
415
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
416
+ input.Filters !== null && {
417
+ Filters: serializeAws_restJson1ListBillingGroupCostReportsFilter(input.Filters, context),
418
+ })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
419
+ return [2, new __HttpRequest({
420
+ protocol: protocol,
421
+ hostname: hostname,
422
+ port: port,
423
+ method: "POST",
424
+ headers: headers,
425
+ path: resolvedPath,
426
+ body: body,
427
+ })];
428
+ }
429
+ });
430
+ }); };
431
+ export var serializeAws_restJson1ListBillingGroupsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
432
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
433
+ return __generator(this, function (_c) {
434
+ switch (_c.label) {
435
+ case 0: return [4, context.endpoint()];
436
+ case 1:
437
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
438
+ headers = {
439
+ "content-type": "application/json",
440
+ };
441
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-billing-groups";
442
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
443
+ input.Filters !== null && { Filters: serializeAws_restJson1ListBillingGroupsFilter(input.Filters, context) })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
444
+ return [2, new __HttpRequest({
445
+ protocol: protocol,
446
+ hostname: hostname,
447
+ port: port,
448
+ method: "POST",
449
+ headers: headers,
450
+ path: resolvedPath,
451
+ body: body,
452
+ })];
453
+ }
454
+ });
455
+ }); };
456
+ export var serializeAws_restJson1ListCustomLineItemsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
457
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
458
+ return __generator(this, function (_c) {
459
+ switch (_c.label) {
460
+ case 0: return [4, context.endpoint()];
461
+ case 1:
462
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
463
+ headers = {
464
+ "content-type": "application/json",
465
+ };
466
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-custom-line-items";
467
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
468
+ input.Filters !== null && { Filters: serializeAws_restJson1ListCustomLineItemsFilter(input.Filters, context) })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
469
+ return [2, new __HttpRequest({
470
+ protocol: protocol,
471
+ hostname: hostname,
472
+ port: port,
473
+ method: "POST",
474
+ headers: headers,
475
+ path: resolvedPath,
476
+ body: body,
477
+ })];
478
+ }
479
+ });
480
+ }); };
481
+ export var serializeAws_restJson1ListPricingPlansCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
482
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
483
+ return __generator(this, function (_c) {
484
+ switch (_c.label) {
485
+ case 0: return [4, context.endpoint()];
486
+ case 1:
487
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
488
+ headers = {
489
+ "content-type": "application/json",
490
+ };
491
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-pricing-plans";
492
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
493
+ input.Filters !== null && { Filters: serializeAws_restJson1ListPricingPlansFilter(input.Filters, context) })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
494
+ return [2, new __HttpRequest({
495
+ protocol: protocol,
496
+ hostname: hostname,
497
+ port: port,
498
+ method: "POST",
499
+ headers: headers,
500
+ path: resolvedPath,
501
+ body: body,
502
+ })];
503
+ }
504
+ });
505
+ }); };
506
+ export var serializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
507
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
508
+ return __generator(this, function (_c) {
509
+ switch (_c.label) {
510
+ case 0: return [4, context.endpoint()];
511
+ case 1:
512
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
513
+ headers = {
514
+ "content-type": "application/json",
515
+ };
516
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
517
+ "/list-pricing-plans-associated-with-pricing-rule";
518
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })), (input.PricingRuleArn !== undefined &&
519
+ input.PricingRuleArn !== null && { PricingRuleArn: input.PricingRuleArn })));
520
+ return [2, new __HttpRequest({
521
+ protocol: protocol,
522
+ hostname: hostname,
523
+ port: port,
524
+ method: "POST",
525
+ headers: headers,
526
+ path: resolvedPath,
527
+ body: body,
528
+ })];
529
+ }
530
+ });
531
+ }); };
532
+ export var serializeAws_restJson1ListPricingRulesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
533
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
534
+ return __generator(this, function (_c) {
535
+ switch (_c.label) {
536
+ case 0: return [4, context.endpoint()];
537
+ case 1:
538
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
539
+ headers = {
540
+ "content-type": "application/json",
541
+ };
542
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/list-pricing-rules";
543
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
544
+ input.Filters !== null && { Filters: serializeAws_restJson1ListPricingRulesFilter(input.Filters, context) })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
545
+ return [2, new __HttpRequest({
546
+ protocol: protocol,
547
+ hostname: hostname,
548
+ port: port,
549
+ method: "POST",
550
+ headers: headers,
551
+ path: resolvedPath,
552
+ body: body,
553
+ })];
554
+ }
555
+ });
556
+ }); };
557
+ export var serializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
558
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
559
+ return __generator(this, function (_c) {
560
+ switch (_c.label) {
561
+ case 0: return [4, context.endpoint()];
562
+ case 1:
563
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
564
+ headers = {
565
+ "content-type": "application/json",
566
+ };
567
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
568
+ "/list-pricing-rules-associated-to-pricing-plan";
569
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })), (input.PricingPlanArn !== undefined &&
570
+ input.PricingPlanArn !== null && { PricingPlanArn: input.PricingPlanArn })));
571
+ return [2, new __HttpRequest({
572
+ protocol: protocol,
573
+ hostname: hostname,
574
+ port: port,
575
+ method: "POST",
576
+ headers: headers,
577
+ path: resolvedPath,
578
+ body: body,
579
+ })];
580
+ }
581
+ });
582
+ }); };
583
+ export var serializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
584
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
585
+ return __generator(this, function (_c) {
586
+ switch (_c.label) {
587
+ case 0: return [4, context.endpoint()];
588
+ case 1:
589
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
590
+ headers = {
591
+ "content-type": "application/json",
592
+ };
593
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
594
+ "/list-resources-associated-to-custom-line-item";
595
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.BillingPeriod !== undefined && input.BillingPeriod !== null && { BillingPeriod: input.BillingPeriod })), (input.Filters !== undefined &&
596
+ input.Filters !== null && {
597
+ Filters: serializeAws_restJson1ListResourcesAssociatedToCustomLineItemFilter(input.Filters, context),
598
+ })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken })));
599
+ return [2, new __HttpRequest({
600
+ protocol: protocol,
601
+ hostname: hostname,
602
+ port: port,
603
+ method: "POST",
604
+ headers: headers,
605
+ path: resolvedPath,
606
+ body: body,
607
+ })];
608
+ }
609
+ });
610
+ }); };
611
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
612
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
613
+ return __generator(this, function (_c) {
614
+ switch (_c.label) {
615
+ case 0: return [4, context.endpoint()];
616
+ case 1:
617
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
618
+ headers = {};
619
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
620
+ if (input.ResourceArn !== undefined) {
621
+ labelValue = input.ResourceArn;
622
+ if (labelValue.length <= 0) {
623
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
624
+ }
625
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
626
+ }
627
+ else {
628
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
629
+ }
630
+ return [2, new __HttpRequest({
631
+ protocol: protocol,
632
+ hostname: hostname,
633
+ port: port,
634
+ method: "GET",
635
+ headers: headers,
636
+ path: resolvedPath,
637
+ body: body,
638
+ })];
639
+ }
640
+ });
641
+ }); };
642
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
643
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
644
+ return __generator(this, function (_c) {
645
+ switch (_c.label) {
646
+ case 0: return [4, context.endpoint()];
647
+ case 1:
648
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
649
+ headers = {
650
+ "content-type": "application/json",
651
+ };
652
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
653
+ if (input.ResourceArn !== undefined) {
654
+ labelValue = input.ResourceArn;
655
+ if (labelValue.length <= 0) {
656
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
657
+ }
658
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
659
+ }
660
+ else {
661
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
662
+ }
663
+ body = JSON.stringify(__assign({}, (input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
664
+ return [2, new __HttpRequest({
665
+ protocol: protocol,
666
+ hostname: hostname,
667
+ port: port,
668
+ method: "POST",
669
+ headers: headers,
670
+ path: resolvedPath,
671
+ body: body,
672
+ })];
673
+ }
674
+ });
675
+ }); };
676
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
677
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
678
+ return __generator(this, function (_c) {
679
+ switch (_c.label) {
680
+ case 0: return [4, context.endpoint()];
681
+ case 1:
682
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
683
+ headers = {};
684
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
685
+ if (input.ResourceArn !== undefined) {
686
+ labelValue = input.ResourceArn;
687
+ if (labelValue.length <= 0) {
688
+ throw new Error("Empty value provided for input HTTP label: ResourceArn.");
689
+ }
690
+ resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
691
+ }
692
+ else {
693
+ throw new Error("No value provided for input HTTP label: ResourceArn.");
694
+ }
695
+ query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
696
+ return [2, new __HttpRequest({
697
+ protocol: protocol,
698
+ hostname: hostname,
699
+ port: port,
700
+ method: "DELETE",
701
+ headers: headers,
702
+ path: resolvedPath,
703
+ query: query,
704
+ body: body,
705
+ })];
706
+ }
707
+ });
708
+ }); };
709
+ export var serializeAws_restJson1UpdateBillingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
710
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
711
+ return __generator(this, function (_c) {
712
+ switch (_c.label) {
713
+ case 0: return [4, context.endpoint()];
714
+ case 1:
715
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
716
+ headers = {
717
+ "content-type": "application/json",
718
+ };
719
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/update-billing-group";
720
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.ComputationPreference !== undefined &&
721
+ input.ComputationPreference !== null && {
722
+ ComputationPreference: serializeAws_restJson1ComputationPreference(input.ComputationPreference, context),
723
+ })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Status !== undefined && input.Status !== null && { Status: input.Status })));
724
+ return [2, new __HttpRequest({
725
+ protocol: protocol,
726
+ hostname: hostname,
727
+ port: port,
728
+ method: "POST",
729
+ headers: headers,
730
+ path: resolvedPath,
731
+ body: body,
732
+ })];
733
+ }
734
+ });
735
+ }); };
736
+ export var serializeAws_restJson1UpdateCustomLineItemCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
737
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
738
+ return __generator(this, function (_c) {
739
+ switch (_c.label) {
740
+ case 0: return [4, context.endpoint()];
741
+ case 1:
742
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
743
+ headers = {
744
+ "content-type": "application/json",
745
+ };
746
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/update-custom-line-item";
747
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.BillingPeriodRange !== undefined &&
748
+ input.BillingPeriodRange !== null && {
749
+ BillingPeriodRange: serializeAws_restJson1CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
750
+ })), (input.ChargeDetails !== undefined &&
751
+ input.ChargeDetails !== null && {
752
+ ChargeDetails: serializeAws_restJson1UpdateCustomLineItemChargeDetails(input.ChargeDetails, context),
753
+ })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })));
754
+ return [2, new __HttpRequest({
755
+ protocol: protocol,
756
+ hostname: hostname,
757
+ port: port,
758
+ method: "POST",
759
+ headers: headers,
760
+ path: resolvedPath,
761
+ body: body,
762
+ })];
763
+ }
764
+ });
765
+ }); };
766
+ export var serializeAws_restJson1UpdatePricingPlanCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
767
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
768
+ return __generator(this, function (_c) {
769
+ switch (_c.label) {
770
+ case 0: return [4, context.endpoint()];
771
+ case 1:
772
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
773
+ headers = {
774
+ "content-type": "application/json",
775
+ };
776
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/update-pricing-plan";
777
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })));
778
+ return [2, new __HttpRequest({
779
+ protocol: protocol,
780
+ hostname: hostname,
781
+ port: port,
782
+ method: "PUT",
783
+ headers: headers,
784
+ path: resolvedPath,
785
+ body: body,
786
+ })];
787
+ }
788
+ });
789
+ }); };
790
+ export var serializeAws_restJson1UpdatePricingRuleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
791
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
792
+ return __generator(this, function (_c) {
793
+ switch (_c.label) {
794
+ case 0: return [4, context.endpoint()];
795
+ case 1:
796
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
797
+ headers = {
798
+ "content-type": "application/json",
799
+ };
800
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/update-pricing-rule";
801
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn })), (input.Description !== undefined && input.Description !== null && { Description: input.Description })), (input.ModifierPercentage !== undefined &&
802
+ input.ModifierPercentage !== null && { ModifierPercentage: __serializeFloat(input.ModifierPercentage) })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Type !== undefined && input.Type !== null && { Type: input.Type })));
803
+ return [2, new __HttpRequest({
804
+ protocol: protocol,
805
+ hostname: hostname,
806
+ port: port,
807
+ method: "PUT",
808
+ headers: headers,
809
+ path: resolvedPath,
810
+ body: body,
811
+ })];
812
+ }
813
+ });
814
+ }); };
815
+ export var deserializeAws_restJson1AssociateAccountsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
816
+ var contents, data, _a, _b;
817
+ return __generator(this, function (_c) {
818
+ switch (_c.label) {
819
+ case 0:
820
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
821
+ return [2, deserializeAws_restJson1AssociateAccountsCommandError(output, context)];
822
+ }
823
+ contents = {
824
+ $metadata: deserializeMetadata(output),
825
+ Arn: undefined,
826
+ };
827
+ _a = __expectNonNull;
828
+ _b = __expectObject;
829
+ return [4, parseBody(output.body, context)];
830
+ case 1:
831
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
832
+ if (data.Arn !== undefined && data.Arn !== null) {
833
+ contents.Arn = __expectString(data.Arn);
834
+ }
835
+ return [2, Promise.resolve(contents)];
836
+ }
837
+ });
838
+ }); };
839
+ var deserializeAws_restJson1AssociateAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
840
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
841
+ var _c;
842
+ return __generator(this, function (_d) {
843
+ switch (_d.label) {
844
+ case 0:
845
+ _a = [__assign({}, output)];
846
+ _c = {};
847
+ return [4, parseBody(output.body, context)];
848
+ case 1:
849
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
850
+ errorCode = "UnknownError";
851
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
852
+ _b = errorCode;
853
+ switch (_b) {
854
+ case "AccessDeniedException": return [3, 2];
855
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
856
+ case "ConflictException": return [3, 4];
857
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
858
+ case "InternalServerException": return [3, 6];
859
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
860
+ case "ResourceNotFoundException": return [3, 8];
861
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
862
+ case "ServiceLimitExceededException": return [3, 10];
863
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 10];
864
+ case "ThrottlingException": return [3, 12];
865
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 12];
866
+ case "ValidationException": return [3, 14];
867
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 14];
868
+ }
869
+ return [3, 16];
870
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
871
+ case 3: throw _d.sent();
872
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
873
+ case 5: throw _d.sent();
874
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
875
+ case 7: throw _d.sent();
876
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
877
+ case 9: throw _d.sent();
878
+ case 10: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
879
+ case 11: throw _d.sent();
880
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
881
+ case 13: throw _d.sent();
882
+ case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
883
+ case 15: throw _d.sent();
884
+ case 16:
885
+ parsedBody = parsedOutput.body;
886
+ response = new __BaseException({
887
+ name: parsedBody.code || parsedBody.Code || errorCode,
888
+ $fault: "client",
889
+ $metadata: deserializeMetadata(output),
890
+ });
891
+ throw __decorateServiceException(response, parsedBody);
892
+ }
893
+ });
894
+ }); };
895
+ export var deserializeAws_restJson1AssociatePricingRulesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
896
+ var contents, data, _a, _b;
897
+ return __generator(this, function (_c) {
898
+ switch (_c.label) {
899
+ case 0:
900
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
901
+ return [2, deserializeAws_restJson1AssociatePricingRulesCommandError(output, context)];
902
+ }
903
+ contents = {
904
+ $metadata: deserializeMetadata(output),
905
+ Arn: undefined,
906
+ };
907
+ _a = __expectNonNull;
908
+ _b = __expectObject;
909
+ return [4, parseBody(output.body, context)];
910
+ case 1:
911
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
912
+ if (data.Arn !== undefined && data.Arn !== null) {
913
+ contents.Arn = __expectString(data.Arn);
914
+ }
915
+ return [2, Promise.resolve(contents)];
916
+ }
917
+ });
918
+ }); };
919
+ var deserializeAws_restJson1AssociatePricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
920
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
921
+ var _c;
922
+ return __generator(this, function (_d) {
923
+ switch (_d.label) {
924
+ case 0:
925
+ _a = [__assign({}, output)];
926
+ _c = {};
927
+ return [4, parseBody(output.body, context)];
928
+ case 1:
929
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
930
+ errorCode = "UnknownError";
931
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
932
+ _b = errorCode;
933
+ switch (_b) {
934
+ case "AccessDeniedException": return [3, 2];
935
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
936
+ case "ConflictException": return [3, 4];
937
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
938
+ case "InternalServerException": return [3, 6];
939
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
940
+ case "ResourceNotFoundException": return [3, 8];
941
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
942
+ case "ServiceLimitExceededException": return [3, 10];
943
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 10];
944
+ case "ThrottlingException": return [3, 12];
945
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 12];
946
+ case "ValidationException": return [3, 14];
947
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 14];
948
+ }
949
+ return [3, 16];
950
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
951
+ case 3: throw _d.sent();
952
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
953
+ case 5: throw _d.sent();
954
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
955
+ case 7: throw _d.sent();
956
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
957
+ case 9: throw _d.sent();
958
+ case 10: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
959
+ case 11: throw _d.sent();
960
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
961
+ case 13: throw _d.sent();
962
+ case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
963
+ case 15: throw _d.sent();
964
+ case 16:
965
+ parsedBody = parsedOutput.body;
966
+ response = new __BaseException({
967
+ name: parsedBody.code || parsedBody.Code || errorCode,
968
+ $fault: "client",
969
+ $metadata: deserializeMetadata(output),
970
+ });
971
+ throw __decorateServiceException(response, parsedBody);
972
+ }
973
+ });
974
+ }); };
975
+ export var deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
976
+ var contents, data, _a, _b;
977
+ return __generator(this, function (_c) {
978
+ switch (_c.label) {
979
+ case 0:
980
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
981
+ return [2, deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError(output, context)];
982
+ }
983
+ contents = {
984
+ $metadata: deserializeMetadata(output),
985
+ FailedAssociatedResources: undefined,
986
+ SuccessfullyAssociatedResources: undefined,
987
+ };
988
+ _a = __expectNonNull;
989
+ _b = __expectObject;
990
+ return [4, parseBody(output.body, context)];
991
+ case 1:
992
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
993
+ if (data.FailedAssociatedResources !== undefined && data.FailedAssociatedResources !== null) {
994
+ contents.FailedAssociatedResources = deserializeAws_restJson1AssociateResourcesResponseList(data.FailedAssociatedResources, context);
995
+ }
996
+ if (data.SuccessfullyAssociatedResources !== undefined && data.SuccessfullyAssociatedResources !== null) {
997
+ contents.SuccessfullyAssociatedResources = deserializeAws_restJson1AssociateResourcesResponseList(data.SuccessfullyAssociatedResources, context);
998
+ }
999
+ return [2, Promise.resolve(contents)];
1000
+ }
1001
+ });
1002
+ }); };
1003
+ var deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1004
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1005
+ var _c;
1006
+ return __generator(this, function (_d) {
1007
+ switch (_d.label) {
1008
+ case 0:
1009
+ _a = [__assign({}, output)];
1010
+ _c = {};
1011
+ return [4, parseBody(output.body, context)];
1012
+ case 1:
1013
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1014
+ errorCode = "UnknownError";
1015
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1016
+ _b = errorCode;
1017
+ switch (_b) {
1018
+ case "AccessDeniedException": return [3, 2];
1019
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1020
+ case "ConflictException": return [3, 4];
1021
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1022
+ case "InternalServerException": return [3, 6];
1023
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1024
+ case "ResourceNotFoundException": return [3, 8];
1025
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
1026
+ case "ServiceLimitExceededException": return [3, 10];
1027
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 10];
1028
+ case "ThrottlingException": return [3, 12];
1029
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 12];
1030
+ case "ValidationException": return [3, 14];
1031
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 14];
1032
+ }
1033
+ return [3, 16];
1034
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1035
+ case 3: throw _d.sent();
1036
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1037
+ case 5: throw _d.sent();
1038
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1039
+ case 7: throw _d.sent();
1040
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1041
+ case 9: throw _d.sent();
1042
+ case 10: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
1043
+ case 11: throw _d.sent();
1044
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1045
+ case 13: throw _d.sent();
1046
+ case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1047
+ case 15: throw _d.sent();
1048
+ case 16:
1049
+ parsedBody = parsedOutput.body;
1050
+ response = new __BaseException({
1051
+ name: parsedBody.code || parsedBody.Code || errorCode,
1052
+ $fault: "client",
1053
+ $metadata: deserializeMetadata(output),
1054
+ });
1055
+ throw __decorateServiceException(response, parsedBody);
1056
+ }
1057
+ });
1058
+ }); };
1059
+ export var deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1060
+ var contents, data, _a, _b;
1061
+ return __generator(this, function (_c) {
1062
+ switch (_c.label) {
1063
+ case 0:
1064
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1065
+ return [2, deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandError(output, context)];
1066
+ }
1067
+ contents = {
1068
+ $metadata: deserializeMetadata(output),
1069
+ FailedDisassociatedResources: undefined,
1070
+ SuccessfullyDisassociatedResources: undefined,
1071
+ };
1072
+ _a = __expectNonNull;
1073
+ _b = __expectObject;
1074
+ return [4, parseBody(output.body, context)];
1075
+ case 1:
1076
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1077
+ if (data.FailedDisassociatedResources !== undefined && data.FailedDisassociatedResources !== null) {
1078
+ contents.FailedDisassociatedResources = deserializeAws_restJson1DisassociateResourcesResponseList(data.FailedDisassociatedResources, context);
1079
+ }
1080
+ if (data.SuccessfullyDisassociatedResources !== undefined && data.SuccessfullyDisassociatedResources !== null) {
1081
+ contents.SuccessfullyDisassociatedResources = deserializeAws_restJson1DisassociateResourcesResponseList(data.SuccessfullyDisassociatedResources, context);
1082
+ }
1083
+ return [2, Promise.resolve(contents)];
1084
+ }
1085
+ });
1086
+ }); };
1087
+ var deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1088
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1089
+ var _c;
1090
+ return __generator(this, function (_d) {
1091
+ switch (_d.label) {
1092
+ case 0:
1093
+ _a = [__assign({}, output)];
1094
+ _c = {};
1095
+ return [4, parseBody(output.body, context)];
1096
+ case 1:
1097
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1098
+ errorCode = "UnknownError";
1099
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1100
+ _b = errorCode;
1101
+ switch (_b) {
1102
+ case "AccessDeniedException": return [3, 2];
1103
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1104
+ case "ConflictException": return [3, 4];
1105
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1106
+ case "InternalServerException": return [3, 6];
1107
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1108
+ case "ResourceNotFoundException": return [3, 8];
1109
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
1110
+ case "ThrottlingException": return [3, 10];
1111
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1112
+ case "ValidationException": return [3, 12];
1113
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1114
+ }
1115
+ return [3, 14];
1116
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1117
+ case 3: throw _d.sent();
1118
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1119
+ case 5: throw _d.sent();
1120
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1121
+ case 7: throw _d.sent();
1122
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1123
+ case 9: throw _d.sent();
1124
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1125
+ case 11: throw _d.sent();
1126
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1127
+ case 13: throw _d.sent();
1128
+ case 14:
1129
+ parsedBody = parsedOutput.body;
1130
+ response = new __BaseException({
1131
+ name: parsedBody.code || parsedBody.Code || errorCode,
1132
+ $fault: "client",
1133
+ $metadata: deserializeMetadata(output),
1134
+ });
1135
+ throw __decorateServiceException(response, parsedBody);
1136
+ }
1137
+ });
1138
+ }); };
1139
+ export var deserializeAws_restJson1CreateBillingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1140
+ var contents, data, _a, _b;
1141
+ return __generator(this, function (_c) {
1142
+ switch (_c.label) {
1143
+ case 0:
1144
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1145
+ return [2, deserializeAws_restJson1CreateBillingGroupCommandError(output, context)];
1146
+ }
1147
+ contents = {
1148
+ $metadata: deserializeMetadata(output),
1149
+ Arn: undefined,
1150
+ };
1151
+ _a = __expectNonNull;
1152
+ _b = __expectObject;
1153
+ return [4, parseBody(output.body, context)];
1154
+ case 1:
1155
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1156
+ if (data.Arn !== undefined && data.Arn !== null) {
1157
+ contents.Arn = __expectString(data.Arn);
1158
+ }
1159
+ return [2, Promise.resolve(contents)];
1160
+ }
1161
+ });
1162
+ }); };
1163
+ var deserializeAws_restJson1CreateBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1164
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1165
+ var _c;
1166
+ return __generator(this, function (_d) {
1167
+ switch (_d.label) {
1168
+ case 0:
1169
+ _a = [__assign({}, output)];
1170
+ _c = {};
1171
+ return [4, parseBody(output.body, context)];
1172
+ case 1:
1173
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1174
+ errorCode = "UnknownError";
1175
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1176
+ _b = errorCode;
1177
+ switch (_b) {
1178
+ case "AccessDeniedException": return [3, 2];
1179
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1180
+ case "ConflictException": return [3, 4];
1181
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1182
+ case "InternalServerException": return [3, 6];
1183
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1184
+ case "ServiceLimitExceededException": return [3, 8];
1185
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 8];
1186
+ case "ThrottlingException": return [3, 10];
1187
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1188
+ case "ValidationException": return [3, 12];
1189
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1190
+ }
1191
+ return [3, 14];
1192
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1193
+ case 3: throw _d.sent();
1194
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1195
+ case 5: throw _d.sent();
1196
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1197
+ case 7: throw _d.sent();
1198
+ case 8: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
1199
+ case 9: throw _d.sent();
1200
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1201
+ case 11: throw _d.sent();
1202
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1203
+ case 13: throw _d.sent();
1204
+ case 14:
1205
+ parsedBody = parsedOutput.body;
1206
+ response = new __BaseException({
1207
+ name: parsedBody.code || parsedBody.Code || errorCode,
1208
+ $fault: "client",
1209
+ $metadata: deserializeMetadata(output),
1210
+ });
1211
+ throw __decorateServiceException(response, parsedBody);
1212
+ }
1213
+ });
1214
+ }); };
1215
+ export var deserializeAws_restJson1CreateCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1216
+ var contents, data, _a, _b;
1217
+ return __generator(this, function (_c) {
1218
+ switch (_c.label) {
1219
+ case 0:
1220
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1221
+ return [2, deserializeAws_restJson1CreateCustomLineItemCommandError(output, context)];
1222
+ }
1223
+ contents = {
1224
+ $metadata: deserializeMetadata(output),
1225
+ Arn: undefined,
1226
+ };
1227
+ _a = __expectNonNull;
1228
+ _b = __expectObject;
1229
+ return [4, parseBody(output.body, context)];
1230
+ case 1:
1231
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1232
+ if (data.Arn !== undefined && data.Arn !== null) {
1233
+ contents.Arn = __expectString(data.Arn);
1234
+ }
1235
+ return [2, Promise.resolve(contents)];
1236
+ }
1237
+ });
1238
+ }); };
1239
+ var deserializeAws_restJson1CreateCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1240
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1241
+ var _c;
1242
+ return __generator(this, function (_d) {
1243
+ switch (_d.label) {
1244
+ case 0:
1245
+ _a = [__assign({}, output)];
1246
+ _c = {};
1247
+ return [4, parseBody(output.body, context)];
1248
+ case 1:
1249
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1250
+ errorCode = "UnknownError";
1251
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1252
+ _b = errorCode;
1253
+ switch (_b) {
1254
+ case "AccessDeniedException": return [3, 2];
1255
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1256
+ case "ConflictException": return [3, 4];
1257
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1258
+ case "InternalServerException": return [3, 6];
1259
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1260
+ case "ServiceLimitExceededException": return [3, 8];
1261
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 8];
1262
+ case "ThrottlingException": return [3, 10];
1263
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1264
+ case "ValidationException": return [3, 12];
1265
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1266
+ }
1267
+ return [3, 14];
1268
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1269
+ case 3: throw _d.sent();
1270
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1271
+ case 5: throw _d.sent();
1272
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1273
+ case 7: throw _d.sent();
1274
+ case 8: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
1275
+ case 9: throw _d.sent();
1276
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1277
+ case 11: throw _d.sent();
1278
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1279
+ case 13: throw _d.sent();
1280
+ case 14:
1281
+ parsedBody = parsedOutput.body;
1282
+ response = new __BaseException({
1283
+ name: parsedBody.code || parsedBody.Code || errorCode,
1284
+ $fault: "client",
1285
+ $metadata: deserializeMetadata(output),
1286
+ });
1287
+ throw __decorateServiceException(response, parsedBody);
1288
+ }
1289
+ });
1290
+ }); };
1291
+ export var deserializeAws_restJson1CreatePricingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1292
+ var contents, data, _a, _b;
1293
+ return __generator(this, function (_c) {
1294
+ switch (_c.label) {
1295
+ case 0:
1296
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1297
+ return [2, deserializeAws_restJson1CreatePricingPlanCommandError(output, context)];
1298
+ }
1299
+ contents = {
1300
+ $metadata: deserializeMetadata(output),
1301
+ Arn: undefined,
1302
+ };
1303
+ _a = __expectNonNull;
1304
+ _b = __expectObject;
1305
+ return [4, parseBody(output.body, context)];
1306
+ case 1:
1307
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1308
+ if (data.Arn !== undefined && data.Arn !== null) {
1309
+ contents.Arn = __expectString(data.Arn);
1310
+ }
1311
+ return [2, Promise.resolve(contents)];
1312
+ }
1313
+ });
1314
+ }); };
1315
+ var deserializeAws_restJson1CreatePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1316
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1317
+ var _c;
1318
+ return __generator(this, function (_d) {
1319
+ switch (_d.label) {
1320
+ case 0:
1321
+ _a = [__assign({}, output)];
1322
+ _c = {};
1323
+ return [4, parseBody(output.body, context)];
1324
+ case 1:
1325
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1326
+ errorCode = "UnknownError";
1327
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1328
+ _b = errorCode;
1329
+ switch (_b) {
1330
+ case "AccessDeniedException": return [3, 2];
1331
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1332
+ case "ConflictException": return [3, 4];
1333
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1334
+ case "InternalServerException": return [3, 6];
1335
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1336
+ case "ResourceNotFoundException": return [3, 8];
1337
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
1338
+ case "ServiceLimitExceededException": return [3, 10];
1339
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 10];
1340
+ case "ThrottlingException": return [3, 12];
1341
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 12];
1342
+ case "ValidationException": return [3, 14];
1343
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 14];
1344
+ }
1345
+ return [3, 16];
1346
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1347
+ case 3: throw _d.sent();
1348
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1349
+ case 5: throw _d.sent();
1350
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1351
+ case 7: throw _d.sent();
1352
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1353
+ case 9: throw _d.sent();
1354
+ case 10: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
1355
+ case 11: throw _d.sent();
1356
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1357
+ case 13: throw _d.sent();
1358
+ case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1359
+ case 15: throw _d.sent();
1360
+ case 16:
1361
+ parsedBody = parsedOutput.body;
1362
+ response = new __BaseException({
1363
+ name: parsedBody.code || parsedBody.Code || errorCode,
1364
+ $fault: "client",
1365
+ $metadata: deserializeMetadata(output),
1366
+ });
1367
+ throw __decorateServiceException(response, parsedBody);
1368
+ }
1369
+ });
1370
+ }); };
1371
+ export var deserializeAws_restJson1CreatePricingRuleCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1372
+ var contents, data, _a, _b;
1373
+ return __generator(this, function (_c) {
1374
+ switch (_c.label) {
1375
+ case 0:
1376
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1377
+ return [2, deserializeAws_restJson1CreatePricingRuleCommandError(output, context)];
1378
+ }
1379
+ contents = {
1380
+ $metadata: deserializeMetadata(output),
1381
+ Arn: undefined,
1382
+ };
1383
+ _a = __expectNonNull;
1384
+ _b = __expectObject;
1385
+ return [4, parseBody(output.body, context)];
1386
+ case 1:
1387
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1388
+ if (data.Arn !== undefined && data.Arn !== null) {
1389
+ contents.Arn = __expectString(data.Arn);
1390
+ }
1391
+ return [2, Promise.resolve(contents)];
1392
+ }
1393
+ });
1394
+ }); };
1395
+ var deserializeAws_restJson1CreatePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1396
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1397
+ var _c;
1398
+ return __generator(this, function (_d) {
1399
+ switch (_d.label) {
1400
+ case 0:
1401
+ _a = [__assign({}, output)];
1402
+ _c = {};
1403
+ return [4, parseBody(output.body, context)];
1404
+ case 1:
1405
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1406
+ errorCode = "UnknownError";
1407
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1408
+ _b = errorCode;
1409
+ switch (_b) {
1410
+ case "AccessDeniedException": return [3, 2];
1411
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1412
+ case "ConflictException": return [3, 4];
1413
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1414
+ case "InternalServerException": return [3, 6];
1415
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1416
+ case "ServiceLimitExceededException": return [3, 8];
1417
+ case "com.amazonaws.billingconductor#ServiceLimitExceededException": return [3, 8];
1418
+ case "ThrottlingException": return [3, 10];
1419
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1420
+ case "ValidationException": return [3, 12];
1421
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1422
+ }
1423
+ return [3, 14];
1424
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1425
+ case 3: throw _d.sent();
1426
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1427
+ case 5: throw _d.sent();
1428
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1429
+ case 7: throw _d.sent();
1430
+ case 8: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
1431
+ case 9: throw _d.sent();
1432
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1433
+ case 11: throw _d.sent();
1434
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1435
+ case 13: throw _d.sent();
1436
+ case 14:
1437
+ parsedBody = parsedOutput.body;
1438
+ response = new __BaseException({
1439
+ name: parsedBody.code || parsedBody.Code || errorCode,
1440
+ $fault: "client",
1441
+ $metadata: deserializeMetadata(output),
1442
+ });
1443
+ throw __decorateServiceException(response, parsedBody);
1444
+ }
1445
+ });
1446
+ }); };
1447
+ export var deserializeAws_restJson1DeleteBillingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1448
+ var contents, data, _a, _b;
1449
+ return __generator(this, function (_c) {
1450
+ switch (_c.label) {
1451
+ case 0:
1452
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1453
+ return [2, deserializeAws_restJson1DeleteBillingGroupCommandError(output, context)];
1454
+ }
1455
+ contents = {
1456
+ $metadata: deserializeMetadata(output),
1457
+ Arn: undefined,
1458
+ };
1459
+ _a = __expectNonNull;
1460
+ _b = __expectObject;
1461
+ return [4, parseBody(output.body, context)];
1462
+ case 1:
1463
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1464
+ if (data.Arn !== undefined && data.Arn !== null) {
1465
+ contents.Arn = __expectString(data.Arn);
1466
+ }
1467
+ return [2, Promise.resolve(contents)];
1468
+ }
1469
+ });
1470
+ }); };
1471
+ var deserializeAws_restJson1DeleteBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1472
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1473
+ var _c;
1474
+ return __generator(this, function (_d) {
1475
+ switch (_d.label) {
1476
+ case 0:
1477
+ _a = [__assign({}, output)];
1478
+ _c = {};
1479
+ return [4, parseBody(output.body, context)];
1480
+ case 1:
1481
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1482
+ errorCode = "UnknownError";
1483
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1484
+ _b = errorCode;
1485
+ switch (_b) {
1486
+ case "AccessDeniedException": return [3, 2];
1487
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1488
+ case "InternalServerException": return [3, 4];
1489
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
1490
+ case "ThrottlingException": return [3, 6];
1491
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 6];
1492
+ case "ValidationException": return [3, 8];
1493
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 8];
1494
+ }
1495
+ return [3, 10];
1496
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1497
+ case 3: throw _d.sent();
1498
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1499
+ case 5: throw _d.sent();
1500
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1501
+ case 7: throw _d.sent();
1502
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1503
+ case 9: throw _d.sent();
1504
+ case 10:
1505
+ parsedBody = parsedOutput.body;
1506
+ response = new __BaseException({
1507
+ name: parsedBody.code || parsedBody.Code || errorCode,
1508
+ $fault: "client",
1509
+ $metadata: deserializeMetadata(output),
1510
+ });
1511
+ throw __decorateServiceException(response, parsedBody);
1512
+ }
1513
+ });
1514
+ }); };
1515
+ export var deserializeAws_restJson1DeleteCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1516
+ var contents, data, _a, _b;
1517
+ return __generator(this, function (_c) {
1518
+ switch (_c.label) {
1519
+ case 0:
1520
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1521
+ return [2, deserializeAws_restJson1DeleteCustomLineItemCommandError(output, context)];
1522
+ }
1523
+ contents = {
1524
+ $metadata: deserializeMetadata(output),
1525
+ Arn: undefined,
1526
+ };
1527
+ _a = __expectNonNull;
1528
+ _b = __expectObject;
1529
+ return [4, parseBody(output.body, context)];
1530
+ case 1:
1531
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1532
+ if (data.Arn !== undefined && data.Arn !== null) {
1533
+ contents.Arn = __expectString(data.Arn);
1534
+ }
1535
+ return [2, Promise.resolve(contents)];
1536
+ }
1537
+ });
1538
+ }); };
1539
+ var deserializeAws_restJson1DeleteCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1540
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1541
+ var _c;
1542
+ return __generator(this, function (_d) {
1543
+ switch (_d.label) {
1544
+ case 0:
1545
+ _a = [__assign({}, output)];
1546
+ _c = {};
1547
+ return [4, parseBody(output.body, context)];
1548
+ case 1:
1549
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1550
+ errorCode = "UnknownError";
1551
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1552
+ _b = errorCode;
1553
+ switch (_b) {
1554
+ case "AccessDeniedException": return [3, 2];
1555
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1556
+ case "ConflictException": return [3, 4];
1557
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1558
+ case "InternalServerException": return [3, 6];
1559
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1560
+ case "ThrottlingException": return [3, 8];
1561
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
1562
+ case "ValidationException": return [3, 10];
1563
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
1564
+ }
1565
+ return [3, 12];
1566
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1567
+ case 3: throw _d.sent();
1568
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1569
+ case 5: throw _d.sent();
1570
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1571
+ case 7: throw _d.sent();
1572
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1573
+ case 9: throw _d.sent();
1574
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1575
+ case 11: throw _d.sent();
1576
+ case 12:
1577
+ parsedBody = parsedOutput.body;
1578
+ response = new __BaseException({
1579
+ name: parsedBody.code || parsedBody.Code || errorCode,
1580
+ $fault: "client",
1581
+ $metadata: deserializeMetadata(output),
1582
+ });
1583
+ throw __decorateServiceException(response, parsedBody);
1584
+ }
1585
+ });
1586
+ }); };
1587
+ export var deserializeAws_restJson1DeletePricingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1588
+ var contents, data, _a, _b;
1589
+ return __generator(this, function (_c) {
1590
+ switch (_c.label) {
1591
+ case 0:
1592
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1593
+ return [2, deserializeAws_restJson1DeletePricingPlanCommandError(output, context)];
1594
+ }
1595
+ contents = {
1596
+ $metadata: deserializeMetadata(output),
1597
+ Arn: undefined,
1598
+ };
1599
+ _a = __expectNonNull;
1600
+ _b = __expectObject;
1601
+ return [4, parseBody(output.body, context)];
1602
+ case 1:
1603
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1604
+ if (data.Arn !== undefined && data.Arn !== null) {
1605
+ contents.Arn = __expectString(data.Arn);
1606
+ }
1607
+ return [2, Promise.resolve(contents)];
1608
+ }
1609
+ });
1610
+ }); };
1611
+ var deserializeAws_restJson1DeletePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1612
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1613
+ var _c;
1614
+ return __generator(this, function (_d) {
1615
+ switch (_d.label) {
1616
+ case 0:
1617
+ _a = [__assign({}, output)];
1618
+ _c = {};
1619
+ return [4, parseBody(output.body, context)];
1620
+ case 1:
1621
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1622
+ errorCode = "UnknownError";
1623
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1624
+ _b = errorCode;
1625
+ switch (_b) {
1626
+ case "AccessDeniedException": return [3, 2];
1627
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1628
+ case "ConflictException": return [3, 4];
1629
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1630
+ case "InternalServerException": return [3, 6];
1631
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1632
+ case "ThrottlingException": return [3, 8];
1633
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
1634
+ case "ValidationException": return [3, 10];
1635
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
1636
+ }
1637
+ return [3, 12];
1638
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1639
+ case 3: throw _d.sent();
1640
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1641
+ case 5: throw _d.sent();
1642
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1643
+ case 7: throw _d.sent();
1644
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1645
+ case 9: throw _d.sent();
1646
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1647
+ case 11: throw _d.sent();
1648
+ case 12:
1649
+ parsedBody = parsedOutput.body;
1650
+ response = new __BaseException({
1651
+ name: parsedBody.code || parsedBody.Code || errorCode,
1652
+ $fault: "client",
1653
+ $metadata: deserializeMetadata(output),
1654
+ });
1655
+ throw __decorateServiceException(response, parsedBody);
1656
+ }
1657
+ });
1658
+ }); };
1659
+ export var deserializeAws_restJson1DeletePricingRuleCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1660
+ var contents, data, _a, _b;
1661
+ return __generator(this, function (_c) {
1662
+ switch (_c.label) {
1663
+ case 0:
1664
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1665
+ return [2, deserializeAws_restJson1DeletePricingRuleCommandError(output, context)];
1666
+ }
1667
+ contents = {
1668
+ $metadata: deserializeMetadata(output),
1669
+ Arn: undefined,
1670
+ };
1671
+ _a = __expectNonNull;
1672
+ _b = __expectObject;
1673
+ return [4, parseBody(output.body, context)];
1674
+ case 1:
1675
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1676
+ if (data.Arn !== undefined && data.Arn !== null) {
1677
+ contents.Arn = __expectString(data.Arn);
1678
+ }
1679
+ return [2, Promise.resolve(contents)];
1680
+ }
1681
+ });
1682
+ }); };
1683
+ var deserializeAws_restJson1DeletePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1684
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1685
+ var _c;
1686
+ return __generator(this, function (_d) {
1687
+ switch (_d.label) {
1688
+ case 0:
1689
+ _a = [__assign({}, output)];
1690
+ _c = {};
1691
+ return [4, parseBody(output.body, context)];
1692
+ case 1:
1693
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1694
+ errorCode = "UnknownError";
1695
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1696
+ _b = errorCode;
1697
+ switch (_b) {
1698
+ case "AccessDeniedException": return [3, 2];
1699
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1700
+ case "ConflictException": return [3, 4];
1701
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1702
+ case "InternalServerException": return [3, 6];
1703
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1704
+ case "ThrottlingException": return [3, 8];
1705
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
1706
+ case "ValidationException": return [3, 10];
1707
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
1708
+ }
1709
+ return [3, 12];
1710
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1711
+ case 3: throw _d.sent();
1712
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1713
+ case 5: throw _d.sent();
1714
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1715
+ case 7: throw _d.sent();
1716
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1717
+ case 9: throw _d.sent();
1718
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1719
+ case 11: throw _d.sent();
1720
+ case 12:
1721
+ parsedBody = parsedOutput.body;
1722
+ response = new __BaseException({
1723
+ name: parsedBody.code || parsedBody.Code || errorCode,
1724
+ $fault: "client",
1725
+ $metadata: deserializeMetadata(output),
1726
+ });
1727
+ throw __decorateServiceException(response, parsedBody);
1728
+ }
1729
+ });
1730
+ }); };
1731
+ export var deserializeAws_restJson1DisassociateAccountsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1732
+ var contents, data, _a, _b;
1733
+ return __generator(this, function (_c) {
1734
+ switch (_c.label) {
1735
+ case 0:
1736
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1737
+ return [2, deserializeAws_restJson1DisassociateAccountsCommandError(output, context)];
1738
+ }
1739
+ contents = {
1740
+ $metadata: deserializeMetadata(output),
1741
+ Arn: undefined,
1742
+ };
1743
+ _a = __expectNonNull;
1744
+ _b = __expectObject;
1745
+ return [4, parseBody(output.body, context)];
1746
+ case 1:
1747
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1748
+ if (data.Arn !== undefined && data.Arn !== null) {
1749
+ contents.Arn = __expectString(data.Arn);
1750
+ }
1751
+ return [2, Promise.resolve(contents)];
1752
+ }
1753
+ });
1754
+ }); };
1755
+ var deserializeAws_restJson1DisassociateAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1756
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1757
+ var _c;
1758
+ return __generator(this, function (_d) {
1759
+ switch (_d.label) {
1760
+ case 0:
1761
+ _a = [__assign({}, output)];
1762
+ _c = {};
1763
+ return [4, parseBody(output.body, context)];
1764
+ case 1:
1765
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1766
+ errorCode = "UnknownError";
1767
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1768
+ _b = errorCode;
1769
+ switch (_b) {
1770
+ case "AccessDeniedException": return [3, 2];
1771
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1772
+ case "ConflictException": return [3, 4];
1773
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1774
+ case "InternalServerException": return [3, 6];
1775
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1776
+ case "ResourceNotFoundException": return [3, 8];
1777
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
1778
+ case "ThrottlingException": return [3, 10];
1779
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1780
+ case "ValidationException": return [3, 12];
1781
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1782
+ }
1783
+ return [3, 14];
1784
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1785
+ case 3: throw _d.sent();
1786
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1787
+ case 5: throw _d.sent();
1788
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1789
+ case 7: throw _d.sent();
1790
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1791
+ case 9: throw _d.sent();
1792
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1793
+ case 11: throw _d.sent();
1794
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1795
+ case 13: throw _d.sent();
1796
+ case 14:
1797
+ parsedBody = parsedOutput.body;
1798
+ response = new __BaseException({
1799
+ name: parsedBody.code || parsedBody.Code || errorCode,
1800
+ $fault: "client",
1801
+ $metadata: deserializeMetadata(output),
1802
+ });
1803
+ throw __decorateServiceException(response, parsedBody);
1804
+ }
1805
+ });
1806
+ }); };
1807
+ export var deserializeAws_restJson1DisassociatePricingRulesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1808
+ var contents, data, _a, _b;
1809
+ return __generator(this, function (_c) {
1810
+ switch (_c.label) {
1811
+ case 0:
1812
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1813
+ return [2, deserializeAws_restJson1DisassociatePricingRulesCommandError(output, context)];
1814
+ }
1815
+ contents = {
1816
+ $metadata: deserializeMetadata(output),
1817
+ Arn: undefined,
1818
+ };
1819
+ _a = __expectNonNull;
1820
+ _b = __expectObject;
1821
+ return [4, parseBody(output.body, context)];
1822
+ case 1:
1823
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1824
+ if (data.Arn !== undefined && data.Arn !== null) {
1825
+ contents.Arn = __expectString(data.Arn);
1826
+ }
1827
+ return [2, Promise.resolve(contents)];
1828
+ }
1829
+ });
1830
+ }); };
1831
+ var deserializeAws_restJson1DisassociatePricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1832
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1833
+ var _c;
1834
+ return __generator(this, function (_d) {
1835
+ switch (_d.label) {
1836
+ case 0:
1837
+ _a = [__assign({}, output)];
1838
+ _c = {};
1839
+ return [4, parseBody(output.body, context)];
1840
+ case 1:
1841
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1842
+ errorCode = "UnknownError";
1843
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1844
+ _b = errorCode;
1845
+ switch (_b) {
1846
+ case "AccessDeniedException": return [3, 2];
1847
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1848
+ case "ConflictException": return [3, 4];
1849
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
1850
+ case "InternalServerException": return [3, 6];
1851
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
1852
+ case "ResourceNotFoundException": return [3, 8];
1853
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
1854
+ case "ThrottlingException": return [3, 10];
1855
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
1856
+ case "ValidationException": return [3, 12];
1857
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
1858
+ }
1859
+ return [3, 14];
1860
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1861
+ case 3: throw _d.sent();
1862
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1863
+ case 5: throw _d.sent();
1864
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1865
+ case 7: throw _d.sent();
1866
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1867
+ case 9: throw _d.sent();
1868
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1869
+ case 11: throw _d.sent();
1870
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1871
+ case 13: throw _d.sent();
1872
+ case 14:
1873
+ parsedBody = parsedOutput.body;
1874
+ response = new __BaseException({
1875
+ name: parsedBody.code || parsedBody.Code || errorCode,
1876
+ $fault: "client",
1877
+ $metadata: deserializeMetadata(output),
1878
+ });
1879
+ throw __decorateServiceException(response, parsedBody);
1880
+ }
1881
+ });
1882
+ }); };
1883
+ export var deserializeAws_restJson1ListAccountAssociationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1884
+ var contents, data, _a, _b;
1885
+ return __generator(this, function (_c) {
1886
+ switch (_c.label) {
1887
+ case 0:
1888
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1889
+ return [2, deserializeAws_restJson1ListAccountAssociationsCommandError(output, context)];
1890
+ }
1891
+ contents = {
1892
+ $metadata: deserializeMetadata(output),
1893
+ LinkedAccounts: undefined,
1894
+ NextToken: undefined,
1895
+ };
1896
+ _a = __expectNonNull;
1897
+ _b = __expectObject;
1898
+ return [4, parseBody(output.body, context)];
1899
+ case 1:
1900
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1901
+ if (data.LinkedAccounts !== undefined && data.LinkedAccounts !== null) {
1902
+ contents.LinkedAccounts = deserializeAws_restJson1AccountAssociationsList(data.LinkedAccounts, context);
1903
+ }
1904
+ if (data.NextToken !== undefined && data.NextToken !== null) {
1905
+ contents.NextToken = __expectString(data.NextToken);
1906
+ }
1907
+ return [2, Promise.resolve(contents)];
1908
+ }
1909
+ });
1910
+ }); };
1911
+ var deserializeAws_restJson1ListAccountAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1912
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1913
+ var _c;
1914
+ return __generator(this, function (_d) {
1915
+ switch (_d.label) {
1916
+ case 0:
1917
+ _a = [__assign({}, output)];
1918
+ _c = {};
1919
+ return [4, parseBody(output.body, context)];
1920
+ case 1:
1921
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1922
+ errorCode = "UnknownError";
1923
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1924
+ _b = errorCode;
1925
+ switch (_b) {
1926
+ case "AccessDeniedException": return [3, 2];
1927
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
1928
+ case "InternalServerException": return [3, 4];
1929
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
1930
+ case "ResourceNotFoundException": return [3, 6];
1931
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
1932
+ case "ThrottlingException": return [3, 8];
1933
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
1934
+ case "ValidationException": return [3, 10];
1935
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
1936
+ }
1937
+ return [3, 12];
1938
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1939
+ case 3: throw _d.sent();
1940
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1941
+ case 5: throw _d.sent();
1942
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1943
+ case 7: throw _d.sent();
1944
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1945
+ case 9: throw _d.sent();
1946
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1947
+ case 11: throw _d.sent();
1948
+ case 12:
1949
+ parsedBody = parsedOutput.body;
1950
+ response = new __BaseException({
1951
+ name: parsedBody.code || parsedBody.Code || errorCode,
1952
+ $fault: "client",
1953
+ $metadata: deserializeMetadata(output),
1954
+ });
1955
+ throw __decorateServiceException(response, parsedBody);
1956
+ }
1957
+ });
1958
+ }); };
1959
+ export var deserializeAws_restJson1ListBillingGroupCostReportsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1960
+ var contents, data, _a, _b;
1961
+ return __generator(this, function (_c) {
1962
+ switch (_c.label) {
1963
+ case 0:
1964
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1965
+ return [2, deserializeAws_restJson1ListBillingGroupCostReportsCommandError(output, context)];
1966
+ }
1967
+ contents = {
1968
+ $metadata: deserializeMetadata(output),
1969
+ BillingGroupCostReports: undefined,
1970
+ NextToken: undefined,
1971
+ };
1972
+ _a = __expectNonNull;
1973
+ _b = __expectObject;
1974
+ return [4, parseBody(output.body, context)];
1975
+ case 1:
1976
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1977
+ if (data.BillingGroupCostReports !== undefined && data.BillingGroupCostReports !== null) {
1978
+ contents.BillingGroupCostReports = deserializeAws_restJson1BillingGroupCostReportList(data.BillingGroupCostReports, context);
1979
+ }
1980
+ if (data.NextToken !== undefined && data.NextToken !== null) {
1981
+ contents.NextToken = __expectString(data.NextToken);
1982
+ }
1983
+ return [2, Promise.resolve(contents)];
1984
+ }
1985
+ });
1986
+ }); };
1987
+ var deserializeAws_restJson1ListBillingGroupCostReportsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1988
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
1989
+ var _c;
1990
+ return __generator(this, function (_d) {
1991
+ switch (_d.label) {
1992
+ case 0:
1993
+ _a = [__assign({}, output)];
1994
+ _c = {};
1995
+ return [4, parseBody(output.body, context)];
1996
+ case 1:
1997
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1998
+ errorCode = "UnknownError";
1999
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2000
+ _b = errorCode;
2001
+ switch (_b) {
2002
+ case "AccessDeniedException": return [3, 2];
2003
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2004
+ case "InternalServerException": return [3, 4];
2005
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2006
+ case "ResourceNotFoundException": return [3, 6];
2007
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2008
+ case "ThrottlingException": return [3, 8];
2009
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2010
+ case "ValidationException": return [3, 10];
2011
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2012
+ }
2013
+ return [3, 12];
2014
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2015
+ case 3: throw _d.sent();
2016
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2017
+ case 5: throw _d.sent();
2018
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2019
+ case 7: throw _d.sent();
2020
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2021
+ case 9: throw _d.sent();
2022
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2023
+ case 11: throw _d.sent();
2024
+ case 12:
2025
+ parsedBody = parsedOutput.body;
2026
+ response = new __BaseException({
2027
+ name: parsedBody.code || parsedBody.Code || errorCode,
2028
+ $fault: "client",
2029
+ $metadata: deserializeMetadata(output),
2030
+ });
2031
+ throw __decorateServiceException(response, parsedBody);
2032
+ }
2033
+ });
2034
+ }); };
2035
+ export var deserializeAws_restJson1ListBillingGroupsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2036
+ var contents, data, _a, _b;
2037
+ return __generator(this, function (_c) {
2038
+ switch (_c.label) {
2039
+ case 0:
2040
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2041
+ return [2, deserializeAws_restJson1ListBillingGroupsCommandError(output, context)];
2042
+ }
2043
+ contents = {
2044
+ $metadata: deserializeMetadata(output),
2045
+ BillingGroups: undefined,
2046
+ NextToken: undefined,
2047
+ };
2048
+ _a = __expectNonNull;
2049
+ _b = __expectObject;
2050
+ return [4, parseBody(output.body, context)];
2051
+ case 1:
2052
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2053
+ if (data.BillingGroups !== undefined && data.BillingGroups !== null) {
2054
+ contents.BillingGroups = deserializeAws_restJson1BillingGroupList(data.BillingGroups, context);
2055
+ }
2056
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2057
+ contents.NextToken = __expectString(data.NextToken);
2058
+ }
2059
+ return [2, Promise.resolve(contents)];
2060
+ }
2061
+ });
2062
+ }); };
2063
+ var deserializeAws_restJson1ListBillingGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2064
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2065
+ var _c;
2066
+ return __generator(this, function (_d) {
2067
+ switch (_d.label) {
2068
+ case 0:
2069
+ _a = [__assign({}, output)];
2070
+ _c = {};
2071
+ return [4, parseBody(output.body, context)];
2072
+ case 1:
2073
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2074
+ errorCode = "UnknownError";
2075
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2076
+ _b = errorCode;
2077
+ switch (_b) {
2078
+ case "AccessDeniedException": return [3, 2];
2079
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2080
+ case "InternalServerException": return [3, 4];
2081
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2082
+ case "ResourceNotFoundException": return [3, 6];
2083
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2084
+ case "ThrottlingException": return [3, 8];
2085
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2086
+ case "ValidationException": return [3, 10];
2087
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2088
+ }
2089
+ return [3, 12];
2090
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2091
+ case 3: throw _d.sent();
2092
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2093
+ case 5: throw _d.sent();
2094
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2095
+ case 7: throw _d.sent();
2096
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2097
+ case 9: throw _d.sent();
2098
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2099
+ case 11: throw _d.sent();
2100
+ case 12:
2101
+ parsedBody = parsedOutput.body;
2102
+ response = new __BaseException({
2103
+ name: parsedBody.code || parsedBody.Code || errorCode,
2104
+ $fault: "client",
2105
+ $metadata: deserializeMetadata(output),
2106
+ });
2107
+ throw __decorateServiceException(response, parsedBody);
2108
+ }
2109
+ });
2110
+ }); };
2111
+ export var deserializeAws_restJson1ListCustomLineItemsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2112
+ var contents, data, _a, _b;
2113
+ return __generator(this, function (_c) {
2114
+ switch (_c.label) {
2115
+ case 0:
2116
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2117
+ return [2, deserializeAws_restJson1ListCustomLineItemsCommandError(output, context)];
2118
+ }
2119
+ contents = {
2120
+ $metadata: deserializeMetadata(output),
2121
+ CustomLineItems: undefined,
2122
+ NextToken: undefined,
2123
+ };
2124
+ _a = __expectNonNull;
2125
+ _b = __expectObject;
2126
+ return [4, parseBody(output.body, context)];
2127
+ case 1:
2128
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2129
+ if (data.CustomLineItems !== undefined && data.CustomLineItems !== null) {
2130
+ contents.CustomLineItems = deserializeAws_restJson1CustomLineItemList(data.CustomLineItems, context);
2131
+ }
2132
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2133
+ contents.NextToken = __expectString(data.NextToken);
2134
+ }
2135
+ return [2, Promise.resolve(contents)];
2136
+ }
2137
+ });
2138
+ }); };
2139
+ var deserializeAws_restJson1ListCustomLineItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2140
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2141
+ var _c;
2142
+ return __generator(this, function (_d) {
2143
+ switch (_d.label) {
2144
+ case 0:
2145
+ _a = [__assign({}, output)];
2146
+ _c = {};
2147
+ return [4, parseBody(output.body, context)];
2148
+ case 1:
2149
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2150
+ errorCode = "UnknownError";
2151
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2152
+ _b = errorCode;
2153
+ switch (_b) {
2154
+ case "AccessDeniedException": return [3, 2];
2155
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2156
+ case "InternalServerException": return [3, 4];
2157
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2158
+ case "ResourceNotFoundException": return [3, 6];
2159
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2160
+ case "ThrottlingException": return [3, 8];
2161
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2162
+ case "ValidationException": return [3, 10];
2163
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2164
+ }
2165
+ return [3, 12];
2166
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2167
+ case 3: throw _d.sent();
2168
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2169
+ case 5: throw _d.sent();
2170
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2171
+ case 7: throw _d.sent();
2172
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2173
+ case 9: throw _d.sent();
2174
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2175
+ case 11: throw _d.sent();
2176
+ case 12:
2177
+ parsedBody = parsedOutput.body;
2178
+ response = new __BaseException({
2179
+ name: parsedBody.code || parsedBody.Code || errorCode,
2180
+ $fault: "client",
2181
+ $metadata: deserializeMetadata(output),
2182
+ });
2183
+ throw __decorateServiceException(response, parsedBody);
2184
+ }
2185
+ });
2186
+ }); };
2187
+ export var deserializeAws_restJson1ListPricingPlansCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2188
+ var contents, data, _a, _b;
2189
+ return __generator(this, function (_c) {
2190
+ switch (_c.label) {
2191
+ case 0:
2192
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2193
+ return [2, deserializeAws_restJson1ListPricingPlansCommandError(output, context)];
2194
+ }
2195
+ contents = {
2196
+ $metadata: deserializeMetadata(output),
2197
+ BillingPeriod: undefined,
2198
+ NextToken: undefined,
2199
+ PricingPlans: undefined,
2200
+ };
2201
+ _a = __expectNonNull;
2202
+ _b = __expectObject;
2203
+ return [4, parseBody(output.body, context)];
2204
+ case 1:
2205
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2206
+ if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2207
+ contents.BillingPeriod = __expectString(data.BillingPeriod);
2208
+ }
2209
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2210
+ contents.NextToken = __expectString(data.NextToken);
2211
+ }
2212
+ if (data.PricingPlans !== undefined && data.PricingPlans !== null) {
2213
+ contents.PricingPlans = deserializeAws_restJson1PricingPlanList(data.PricingPlans, context);
2214
+ }
2215
+ return [2, Promise.resolve(contents)];
2216
+ }
2217
+ });
2218
+ }); };
2219
+ var deserializeAws_restJson1ListPricingPlansCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2220
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2221
+ var _c;
2222
+ return __generator(this, function (_d) {
2223
+ switch (_d.label) {
2224
+ case 0:
2225
+ _a = [__assign({}, output)];
2226
+ _c = {};
2227
+ return [4, parseBody(output.body, context)];
2228
+ case 1:
2229
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2230
+ errorCode = "UnknownError";
2231
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2232
+ _b = errorCode;
2233
+ switch (_b) {
2234
+ case "AccessDeniedException": return [3, 2];
2235
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2236
+ case "InternalServerException": return [3, 4];
2237
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2238
+ case "ThrottlingException": return [3, 6];
2239
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 6];
2240
+ case "ValidationException": return [3, 8];
2241
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 8];
2242
+ }
2243
+ return [3, 10];
2244
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2245
+ case 3: throw _d.sent();
2246
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2247
+ case 5: throw _d.sent();
2248
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2249
+ case 7: throw _d.sent();
2250
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2251
+ case 9: throw _d.sent();
2252
+ case 10:
2253
+ parsedBody = parsedOutput.body;
2254
+ response = new __BaseException({
2255
+ name: parsedBody.code || parsedBody.Code || errorCode,
2256
+ $fault: "client",
2257
+ $metadata: deserializeMetadata(output),
2258
+ });
2259
+ throw __decorateServiceException(response, parsedBody);
2260
+ }
2261
+ });
2262
+ }); };
2263
+ export var deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2264
+ var contents, data, _a, _b;
2265
+ return __generator(this, function (_c) {
2266
+ switch (_c.label) {
2267
+ case 0:
2268
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2269
+ return [2, deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandError(output, context)];
2270
+ }
2271
+ contents = {
2272
+ $metadata: deserializeMetadata(output),
2273
+ BillingPeriod: undefined,
2274
+ NextToken: undefined,
2275
+ PricingPlanArns: undefined,
2276
+ PricingRuleArn: undefined,
2277
+ };
2278
+ _a = __expectNonNull;
2279
+ _b = __expectObject;
2280
+ return [4, parseBody(output.body, context)];
2281
+ case 1:
2282
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2283
+ if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2284
+ contents.BillingPeriod = __expectString(data.BillingPeriod);
2285
+ }
2286
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2287
+ contents.NextToken = __expectString(data.NextToken);
2288
+ }
2289
+ if (data.PricingPlanArns !== undefined && data.PricingPlanArns !== null) {
2290
+ contents.PricingPlanArns = deserializeAws_restJson1PricingPlanArns(data.PricingPlanArns, context);
2291
+ }
2292
+ if (data.PricingRuleArn !== undefined && data.PricingRuleArn !== null) {
2293
+ contents.PricingRuleArn = __expectString(data.PricingRuleArn);
2294
+ }
2295
+ return [2, Promise.resolve(contents)];
2296
+ }
2297
+ });
2298
+ }); };
2299
+ var deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2300
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2301
+ var _c;
2302
+ return __generator(this, function (_d) {
2303
+ switch (_d.label) {
2304
+ case 0:
2305
+ _a = [__assign({}, output)];
2306
+ _c = {};
2307
+ return [4, parseBody(output.body, context)];
2308
+ case 1:
2309
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2310
+ errorCode = "UnknownError";
2311
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2312
+ _b = errorCode;
2313
+ switch (_b) {
2314
+ case "AccessDeniedException": return [3, 2];
2315
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2316
+ case "InternalServerException": return [3, 4];
2317
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2318
+ case "ResourceNotFoundException": return [3, 6];
2319
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2320
+ case "ThrottlingException": return [3, 8];
2321
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2322
+ case "ValidationException": return [3, 10];
2323
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2324
+ }
2325
+ return [3, 12];
2326
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2327
+ case 3: throw _d.sent();
2328
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2329
+ case 5: throw _d.sent();
2330
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2331
+ case 7: throw _d.sent();
2332
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2333
+ case 9: throw _d.sent();
2334
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2335
+ case 11: throw _d.sent();
2336
+ case 12:
2337
+ parsedBody = parsedOutput.body;
2338
+ response = new __BaseException({
2339
+ name: parsedBody.code || parsedBody.Code || errorCode,
2340
+ $fault: "client",
2341
+ $metadata: deserializeMetadata(output),
2342
+ });
2343
+ throw __decorateServiceException(response, parsedBody);
2344
+ }
2345
+ });
2346
+ }); };
2347
+ export var deserializeAws_restJson1ListPricingRulesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2348
+ var contents, data, _a, _b;
2349
+ return __generator(this, function (_c) {
2350
+ switch (_c.label) {
2351
+ case 0:
2352
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2353
+ return [2, deserializeAws_restJson1ListPricingRulesCommandError(output, context)];
2354
+ }
2355
+ contents = {
2356
+ $metadata: deserializeMetadata(output),
2357
+ BillingPeriod: undefined,
2358
+ NextToken: undefined,
2359
+ PricingRules: undefined,
2360
+ };
2361
+ _a = __expectNonNull;
2362
+ _b = __expectObject;
2363
+ return [4, parseBody(output.body, context)];
2364
+ case 1:
2365
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2366
+ if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2367
+ contents.BillingPeriod = __expectString(data.BillingPeriod);
2368
+ }
2369
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2370
+ contents.NextToken = __expectString(data.NextToken);
2371
+ }
2372
+ if (data.PricingRules !== undefined && data.PricingRules !== null) {
2373
+ contents.PricingRules = deserializeAws_restJson1PricingRuleList(data.PricingRules, context);
2374
+ }
2375
+ return [2, Promise.resolve(contents)];
2376
+ }
2377
+ });
2378
+ }); };
2379
+ var deserializeAws_restJson1ListPricingRulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2380
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2381
+ var _c;
2382
+ return __generator(this, function (_d) {
2383
+ switch (_d.label) {
2384
+ case 0:
2385
+ _a = [__assign({}, output)];
2386
+ _c = {};
2387
+ return [4, parseBody(output.body, context)];
2388
+ case 1:
2389
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2390
+ errorCode = "UnknownError";
2391
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2392
+ _b = errorCode;
2393
+ switch (_b) {
2394
+ case "AccessDeniedException": return [3, 2];
2395
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2396
+ case "InternalServerException": return [3, 4];
2397
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2398
+ case "ThrottlingException": return [3, 6];
2399
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 6];
2400
+ case "ValidationException": return [3, 8];
2401
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 8];
2402
+ }
2403
+ return [3, 10];
2404
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2405
+ case 3: throw _d.sent();
2406
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2407
+ case 5: throw _d.sent();
2408
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2409
+ case 7: throw _d.sent();
2410
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2411
+ case 9: throw _d.sent();
2412
+ case 10:
2413
+ parsedBody = parsedOutput.body;
2414
+ response = new __BaseException({
2415
+ name: parsedBody.code || parsedBody.Code || errorCode,
2416
+ $fault: "client",
2417
+ $metadata: deserializeMetadata(output),
2418
+ });
2419
+ throw __decorateServiceException(response, parsedBody);
2420
+ }
2421
+ });
2422
+ }); };
2423
+ export var deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2424
+ var contents, data, _a, _b;
2425
+ return __generator(this, function (_c) {
2426
+ switch (_c.label) {
2427
+ case 0:
2428
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2429
+ return [2, deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError(output, context)];
2430
+ }
2431
+ contents = {
2432
+ $metadata: deserializeMetadata(output),
2433
+ BillingPeriod: undefined,
2434
+ NextToken: undefined,
2435
+ PricingPlanArn: undefined,
2436
+ PricingRuleArns: undefined,
2437
+ };
2438
+ _a = __expectNonNull;
2439
+ _b = __expectObject;
2440
+ return [4, parseBody(output.body, context)];
2441
+ case 1:
2442
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2443
+ if (data.BillingPeriod !== undefined && data.BillingPeriod !== null) {
2444
+ contents.BillingPeriod = __expectString(data.BillingPeriod);
2445
+ }
2446
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2447
+ contents.NextToken = __expectString(data.NextToken);
2448
+ }
2449
+ if (data.PricingPlanArn !== undefined && data.PricingPlanArn !== null) {
2450
+ contents.PricingPlanArn = __expectString(data.PricingPlanArn);
2451
+ }
2452
+ if (data.PricingRuleArns !== undefined && data.PricingRuleArns !== null) {
2453
+ contents.PricingRuleArns = deserializeAws_restJson1PricingRuleArns(data.PricingRuleArns, context);
2454
+ }
2455
+ return [2, Promise.resolve(contents)];
2456
+ }
2457
+ });
2458
+ }); };
2459
+ var deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2460
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2461
+ var _c;
2462
+ return __generator(this, function (_d) {
2463
+ switch (_d.label) {
2464
+ case 0:
2465
+ _a = [__assign({}, output)];
2466
+ _c = {};
2467
+ return [4, parseBody(output.body, context)];
2468
+ case 1:
2469
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2470
+ errorCode = "UnknownError";
2471
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2472
+ _b = errorCode;
2473
+ switch (_b) {
2474
+ case "AccessDeniedException": return [3, 2];
2475
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2476
+ case "InternalServerException": return [3, 4];
2477
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2478
+ case "ResourceNotFoundException": return [3, 6];
2479
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2480
+ case "ThrottlingException": return [3, 8];
2481
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2482
+ case "ValidationException": return [3, 10];
2483
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2484
+ }
2485
+ return [3, 12];
2486
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2487
+ case 3: throw _d.sent();
2488
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2489
+ case 5: throw _d.sent();
2490
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2491
+ case 7: throw _d.sent();
2492
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2493
+ case 9: throw _d.sent();
2494
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2495
+ case 11: throw _d.sent();
2496
+ case 12:
2497
+ parsedBody = parsedOutput.body;
2498
+ response = new __BaseException({
2499
+ name: parsedBody.code || parsedBody.Code || errorCode,
2500
+ $fault: "client",
2501
+ $metadata: deserializeMetadata(output),
2502
+ });
2503
+ throw __decorateServiceException(response, parsedBody);
2504
+ }
2505
+ });
2506
+ }); };
2507
+ export var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2508
+ var contents, data, _a, _b;
2509
+ return __generator(this, function (_c) {
2510
+ switch (_c.label) {
2511
+ case 0:
2512
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2513
+ return [2, deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError(output, context)];
2514
+ }
2515
+ contents = {
2516
+ $metadata: deserializeMetadata(output),
2517
+ Arn: undefined,
2518
+ AssociatedResources: undefined,
2519
+ NextToken: undefined,
2520
+ };
2521
+ _a = __expectNonNull;
2522
+ _b = __expectObject;
2523
+ return [4, parseBody(output.body, context)];
2524
+ case 1:
2525
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2526
+ if (data.Arn !== undefined && data.Arn !== null) {
2527
+ contents.Arn = __expectString(data.Arn);
2528
+ }
2529
+ if (data.AssociatedResources !== undefined && data.AssociatedResources !== null) {
2530
+ contents.AssociatedResources = deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemResponseList(data.AssociatedResources, context);
2531
+ }
2532
+ if (data.NextToken !== undefined && data.NextToken !== null) {
2533
+ contents.NextToken = __expectString(data.NextToken);
2534
+ }
2535
+ return [2, Promise.resolve(contents)];
2536
+ }
2537
+ });
2538
+ }); };
2539
+ var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2540
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2541
+ var _c;
2542
+ return __generator(this, function (_d) {
2543
+ switch (_d.label) {
2544
+ case 0:
2545
+ _a = [__assign({}, output)];
2546
+ _c = {};
2547
+ return [4, parseBody(output.body, context)];
2548
+ case 1:
2549
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2550
+ errorCode = "UnknownError";
2551
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2552
+ _b = errorCode;
2553
+ switch (_b) {
2554
+ case "AccessDeniedException": return [3, 2];
2555
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2556
+ case "InternalServerException": return [3, 4];
2557
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2558
+ case "ResourceNotFoundException": return [3, 6];
2559
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2560
+ case "ThrottlingException": return [3, 8];
2561
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2562
+ case "ValidationException": return [3, 10];
2563
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2564
+ }
2565
+ return [3, 12];
2566
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2567
+ case 3: throw _d.sent();
2568
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2569
+ case 5: throw _d.sent();
2570
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2571
+ case 7: throw _d.sent();
2572
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2573
+ case 9: throw _d.sent();
2574
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2575
+ case 11: throw _d.sent();
2576
+ case 12:
2577
+ parsedBody = parsedOutput.body;
2578
+ response = new __BaseException({
2579
+ name: parsedBody.code || parsedBody.Code || errorCode,
2580
+ $fault: "client",
2581
+ $metadata: deserializeMetadata(output),
2582
+ });
2583
+ throw __decorateServiceException(response, parsedBody);
2584
+ }
2585
+ });
2586
+ }); };
2587
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2588
+ var contents, data, _a, _b;
2589
+ return __generator(this, function (_c) {
2590
+ switch (_c.label) {
2591
+ case 0:
2592
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
2593
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2594
+ }
2595
+ contents = {
2596
+ $metadata: deserializeMetadata(output),
2597
+ Tags: undefined,
2598
+ };
2599
+ _a = __expectNonNull;
2600
+ _b = __expectObject;
2601
+ return [4, parseBody(output.body, context)];
2602
+ case 1:
2603
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2604
+ if (data.Tags !== undefined && data.Tags !== null) {
2605
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2606
+ }
2607
+ return [2, Promise.resolve(contents)];
2608
+ }
2609
+ });
2610
+ }); };
2611
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2612
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2613
+ var _c;
2614
+ return __generator(this, function (_d) {
2615
+ switch (_d.label) {
2616
+ case 0:
2617
+ _a = [__assign({}, output)];
2618
+ _c = {};
2619
+ return [4, parseBody(output.body, context)];
2620
+ case 1:
2621
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2622
+ errorCode = "UnknownError";
2623
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2624
+ _b = errorCode;
2625
+ switch (_b) {
2626
+ case "AccessDeniedException": return [3, 2];
2627
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2628
+ case "InternalServerException": return [3, 4];
2629
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2630
+ case "ResourceNotFoundException": return [3, 6];
2631
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2632
+ case "ThrottlingException": return [3, 8];
2633
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2634
+ case "ValidationException": return [3, 10];
2635
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2636
+ }
2637
+ return [3, 12];
2638
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2639
+ case 3: throw _d.sent();
2640
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2641
+ case 5: throw _d.sent();
2642
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2643
+ case 7: throw _d.sent();
2644
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2645
+ case 9: throw _d.sent();
2646
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2647
+ case 11: throw _d.sent();
2648
+ case 12:
2649
+ parsedBody = parsedOutput.body;
2650
+ response = new __BaseException({
2651
+ name: parsedBody.code || parsedBody.Code || errorCode,
2652
+ $fault: "client",
2653
+ $metadata: deserializeMetadata(output),
2654
+ });
2655
+ throw __decorateServiceException(response, parsedBody);
2656
+ }
2657
+ });
2658
+ }); };
2659
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2660
+ var contents;
2661
+ return __generator(this, function (_a) {
2662
+ switch (_a.label) {
2663
+ case 0:
2664
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
2665
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2666
+ }
2667
+ contents = {
2668
+ $metadata: deserializeMetadata(output),
2669
+ };
2670
+ return [4, collectBody(output.body, context)];
2671
+ case 1:
2672
+ _a.sent();
2673
+ return [2, Promise.resolve(contents)];
2674
+ }
2675
+ });
2676
+ }); };
2677
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2678
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2679
+ var _c;
2680
+ return __generator(this, function (_d) {
2681
+ switch (_d.label) {
2682
+ case 0:
2683
+ _a = [__assign({}, output)];
2684
+ _c = {};
2685
+ return [4, parseBody(output.body, context)];
2686
+ case 1:
2687
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2688
+ errorCode = "UnknownError";
2689
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2690
+ _b = errorCode;
2691
+ switch (_b) {
2692
+ case "AccessDeniedException": return [3, 2];
2693
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2694
+ case "InternalServerException": return [3, 4];
2695
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2696
+ case "ResourceNotFoundException": return [3, 6];
2697
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2698
+ case "ThrottlingException": return [3, 8];
2699
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2700
+ case "ValidationException": return [3, 10];
2701
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2702
+ }
2703
+ return [3, 12];
2704
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2705
+ case 3: throw _d.sent();
2706
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2707
+ case 5: throw _d.sent();
2708
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2709
+ case 7: throw _d.sent();
2710
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2711
+ case 9: throw _d.sent();
2712
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2713
+ case 11: throw _d.sent();
2714
+ case 12:
2715
+ parsedBody = parsedOutput.body;
2716
+ response = new __BaseException({
2717
+ name: parsedBody.code || parsedBody.Code || errorCode,
2718
+ $fault: "client",
2719
+ $metadata: deserializeMetadata(output),
2720
+ });
2721
+ throw __decorateServiceException(response, parsedBody);
2722
+ }
2723
+ });
2724
+ }); };
2725
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2726
+ var contents;
2727
+ return __generator(this, function (_a) {
2728
+ switch (_a.label) {
2729
+ case 0:
2730
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
2731
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2732
+ }
2733
+ contents = {
2734
+ $metadata: deserializeMetadata(output),
2735
+ };
2736
+ return [4, collectBody(output.body, context)];
2737
+ case 1:
2738
+ _a.sent();
2739
+ return [2, Promise.resolve(contents)];
2740
+ }
2741
+ });
2742
+ }); };
2743
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2744
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2745
+ var _c;
2746
+ return __generator(this, function (_d) {
2747
+ switch (_d.label) {
2748
+ case 0:
2749
+ _a = [__assign({}, output)];
2750
+ _c = {};
2751
+ return [4, parseBody(output.body, context)];
2752
+ case 1:
2753
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2754
+ errorCode = "UnknownError";
2755
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2756
+ _b = errorCode;
2757
+ switch (_b) {
2758
+ case "AccessDeniedException": return [3, 2];
2759
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2760
+ case "InternalServerException": return [3, 4];
2761
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2762
+ case "ResourceNotFoundException": return [3, 6];
2763
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2764
+ case "ThrottlingException": return [3, 8];
2765
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2766
+ case "ValidationException": return [3, 10];
2767
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2768
+ }
2769
+ return [3, 12];
2770
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2771
+ case 3: throw _d.sent();
2772
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2773
+ case 5: throw _d.sent();
2774
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2775
+ case 7: throw _d.sent();
2776
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2777
+ case 9: throw _d.sent();
2778
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2779
+ case 11: throw _d.sent();
2780
+ case 12:
2781
+ parsedBody = parsedOutput.body;
2782
+ response = new __BaseException({
2783
+ name: parsedBody.code || parsedBody.Code || errorCode,
2784
+ $fault: "client",
2785
+ $metadata: deserializeMetadata(output),
2786
+ });
2787
+ throw __decorateServiceException(response, parsedBody);
2788
+ }
2789
+ });
2790
+ }); };
2791
+ export var deserializeAws_restJson1UpdateBillingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2792
+ var contents, data, _a, _b;
2793
+ return __generator(this, function (_c) {
2794
+ switch (_c.label) {
2795
+ case 0:
2796
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2797
+ return [2, deserializeAws_restJson1UpdateBillingGroupCommandError(output, context)];
2798
+ }
2799
+ contents = {
2800
+ $metadata: deserializeMetadata(output),
2801
+ Arn: undefined,
2802
+ Description: undefined,
2803
+ LastModifiedTime: undefined,
2804
+ Name: undefined,
2805
+ PricingPlanArn: undefined,
2806
+ PrimaryAccountId: undefined,
2807
+ Size: undefined,
2808
+ Status: undefined,
2809
+ StatusReason: undefined,
2810
+ };
2811
+ _a = __expectNonNull;
2812
+ _b = __expectObject;
2813
+ return [4, parseBody(output.body, context)];
2814
+ case 1:
2815
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2816
+ if (data.Arn !== undefined && data.Arn !== null) {
2817
+ contents.Arn = __expectString(data.Arn);
2818
+ }
2819
+ if (data.Description !== undefined && data.Description !== null) {
2820
+ contents.Description = __expectString(data.Description);
2821
+ }
2822
+ if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2823
+ contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2824
+ }
2825
+ if (data.Name !== undefined && data.Name !== null) {
2826
+ contents.Name = __expectString(data.Name);
2827
+ }
2828
+ if (data.PricingPlanArn !== undefined && data.PricingPlanArn !== null) {
2829
+ contents.PricingPlanArn = __expectString(data.PricingPlanArn);
2830
+ }
2831
+ if (data.PrimaryAccountId !== undefined && data.PrimaryAccountId !== null) {
2832
+ contents.PrimaryAccountId = __expectString(data.PrimaryAccountId);
2833
+ }
2834
+ if (data.Size !== undefined && data.Size !== null) {
2835
+ contents.Size = __expectLong(data.Size);
2836
+ }
2837
+ if (data.Status !== undefined && data.Status !== null) {
2838
+ contents.Status = __expectString(data.Status);
2839
+ }
2840
+ if (data.StatusReason !== undefined && data.StatusReason !== null) {
2841
+ contents.StatusReason = __expectString(data.StatusReason);
2842
+ }
2843
+ return [2, Promise.resolve(contents)];
2844
+ }
2845
+ });
2846
+ }); };
2847
+ var deserializeAws_restJson1UpdateBillingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2848
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2849
+ var _c;
2850
+ return __generator(this, function (_d) {
2851
+ switch (_d.label) {
2852
+ case 0:
2853
+ _a = [__assign({}, output)];
2854
+ _c = {};
2855
+ return [4, parseBody(output.body, context)];
2856
+ case 1:
2857
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2858
+ errorCode = "UnknownError";
2859
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2860
+ _b = errorCode;
2861
+ switch (_b) {
2862
+ case "AccessDeniedException": return [3, 2];
2863
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2864
+ case "ConflictException": return [3, 4];
2865
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
2866
+ case "InternalServerException": return [3, 6];
2867
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
2868
+ case "ResourceNotFoundException": return [3, 8];
2869
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
2870
+ case "ThrottlingException": return [3, 10];
2871
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
2872
+ case "ValidationException": return [3, 12];
2873
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
2874
+ }
2875
+ return [3, 14];
2876
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2877
+ case 3: throw _d.sent();
2878
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2879
+ case 5: throw _d.sent();
2880
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2881
+ case 7: throw _d.sent();
2882
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2883
+ case 9: throw _d.sent();
2884
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2885
+ case 11: throw _d.sent();
2886
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2887
+ case 13: throw _d.sent();
2888
+ case 14:
2889
+ parsedBody = parsedOutput.body;
2890
+ response = new __BaseException({
2891
+ name: parsedBody.code || parsedBody.Code || errorCode,
2892
+ $fault: "client",
2893
+ $metadata: deserializeMetadata(output),
2894
+ });
2895
+ throw __decorateServiceException(response, parsedBody);
2896
+ }
2897
+ });
2898
+ }); };
2899
+ export var deserializeAws_restJson1UpdateCustomLineItemCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2900
+ var contents, data, _a, _b;
2901
+ return __generator(this, function (_c) {
2902
+ switch (_c.label) {
2903
+ case 0:
2904
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2905
+ return [2, deserializeAws_restJson1UpdateCustomLineItemCommandError(output, context)];
2906
+ }
2907
+ contents = {
2908
+ $metadata: deserializeMetadata(output),
2909
+ Arn: undefined,
2910
+ AssociationSize: undefined,
2911
+ BillingGroupArn: undefined,
2912
+ ChargeDetails: undefined,
2913
+ Description: undefined,
2914
+ LastModifiedTime: undefined,
2915
+ Name: undefined,
2916
+ };
2917
+ _a = __expectNonNull;
2918
+ _b = __expectObject;
2919
+ return [4, parseBody(output.body, context)];
2920
+ case 1:
2921
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2922
+ if (data.Arn !== undefined && data.Arn !== null) {
2923
+ contents.Arn = __expectString(data.Arn);
2924
+ }
2925
+ if (data.AssociationSize !== undefined && data.AssociationSize !== null) {
2926
+ contents.AssociationSize = __expectLong(data.AssociationSize);
2927
+ }
2928
+ if (data.BillingGroupArn !== undefined && data.BillingGroupArn !== null) {
2929
+ contents.BillingGroupArn = __expectString(data.BillingGroupArn);
2930
+ }
2931
+ if (data.ChargeDetails !== undefined && data.ChargeDetails !== null) {
2932
+ contents.ChargeDetails = deserializeAws_restJson1ListCustomLineItemChargeDetails(data.ChargeDetails, context);
2933
+ }
2934
+ if (data.Description !== undefined && data.Description !== null) {
2935
+ contents.Description = __expectString(data.Description);
2936
+ }
2937
+ if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2938
+ contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2939
+ }
2940
+ if (data.Name !== undefined && data.Name !== null) {
2941
+ contents.Name = __expectString(data.Name);
2942
+ }
2943
+ return [2, Promise.resolve(contents)];
2944
+ }
2945
+ });
2946
+ }); };
2947
+ var deserializeAws_restJson1UpdateCustomLineItemCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2948
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
2949
+ var _c;
2950
+ return __generator(this, function (_d) {
2951
+ switch (_d.label) {
2952
+ case 0:
2953
+ _a = [__assign({}, output)];
2954
+ _c = {};
2955
+ return [4, parseBody(output.body, context)];
2956
+ case 1:
2957
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2958
+ errorCode = "UnknownError";
2959
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2960
+ _b = errorCode;
2961
+ switch (_b) {
2962
+ case "AccessDeniedException": return [3, 2];
2963
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
2964
+ case "InternalServerException": return [3, 4];
2965
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 4];
2966
+ case "ResourceNotFoundException": return [3, 6];
2967
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 6];
2968
+ case "ThrottlingException": return [3, 8];
2969
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 8];
2970
+ case "ValidationException": return [3, 10];
2971
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 10];
2972
+ }
2973
+ return [3, 12];
2974
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2975
+ case 3: throw _d.sent();
2976
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2977
+ case 5: throw _d.sent();
2978
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2979
+ case 7: throw _d.sent();
2980
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2981
+ case 9: throw _d.sent();
2982
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2983
+ case 11: throw _d.sent();
2984
+ case 12:
2985
+ parsedBody = parsedOutput.body;
2986
+ response = new __BaseException({
2987
+ name: parsedBody.code || parsedBody.Code || errorCode,
2988
+ $fault: "client",
2989
+ $metadata: deserializeMetadata(output),
2990
+ });
2991
+ throw __decorateServiceException(response, parsedBody);
2992
+ }
2993
+ });
2994
+ }); };
2995
+ export var deserializeAws_restJson1UpdatePricingPlanCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2996
+ var contents, data, _a, _b;
2997
+ return __generator(this, function (_c) {
2998
+ switch (_c.label) {
2999
+ case 0:
3000
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3001
+ return [2, deserializeAws_restJson1UpdatePricingPlanCommandError(output, context)];
3002
+ }
3003
+ contents = {
3004
+ $metadata: deserializeMetadata(output),
3005
+ Arn: undefined,
3006
+ Description: undefined,
3007
+ LastModifiedTime: undefined,
3008
+ Name: undefined,
3009
+ Size: undefined,
3010
+ };
3011
+ _a = __expectNonNull;
3012
+ _b = __expectObject;
3013
+ return [4, parseBody(output.body, context)];
3014
+ case 1:
3015
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3016
+ if (data.Arn !== undefined && data.Arn !== null) {
3017
+ contents.Arn = __expectString(data.Arn);
3018
+ }
3019
+ if (data.Description !== undefined && data.Description !== null) {
3020
+ contents.Description = __expectString(data.Description);
3021
+ }
3022
+ if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3023
+ contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
3024
+ }
3025
+ if (data.Name !== undefined && data.Name !== null) {
3026
+ contents.Name = __expectString(data.Name);
3027
+ }
3028
+ if (data.Size !== undefined && data.Size !== null) {
3029
+ contents.Size = __expectLong(data.Size);
3030
+ }
3031
+ return [2, Promise.resolve(contents)];
3032
+ }
3033
+ });
3034
+ }); };
3035
+ var deserializeAws_restJson1UpdatePricingPlanCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3036
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
3037
+ var _c;
3038
+ return __generator(this, function (_d) {
3039
+ switch (_d.label) {
3040
+ case 0:
3041
+ _a = [__assign({}, output)];
3042
+ _c = {};
3043
+ return [4, parseBody(output.body, context)];
3044
+ case 1:
3045
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3046
+ errorCode = "UnknownError";
3047
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3048
+ _b = errorCode;
3049
+ switch (_b) {
3050
+ case "AccessDeniedException": return [3, 2];
3051
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
3052
+ case "ConflictException": return [3, 4];
3053
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
3054
+ case "InternalServerException": return [3, 6];
3055
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
3056
+ case "ResourceNotFoundException": return [3, 8];
3057
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
3058
+ case "ThrottlingException": return [3, 10];
3059
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
3060
+ case "ValidationException": return [3, 12];
3061
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
3062
+ }
3063
+ return [3, 14];
3064
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3065
+ case 3: throw _d.sent();
3066
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
3067
+ case 5: throw _d.sent();
3068
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3069
+ case 7: throw _d.sent();
3070
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3071
+ case 9: throw _d.sent();
3072
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3073
+ case 11: throw _d.sent();
3074
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3075
+ case 13: throw _d.sent();
3076
+ case 14:
3077
+ parsedBody = parsedOutput.body;
3078
+ response = new __BaseException({
3079
+ name: parsedBody.code || parsedBody.Code || errorCode,
3080
+ $fault: "client",
3081
+ $metadata: deserializeMetadata(output),
3082
+ });
3083
+ throw __decorateServiceException(response, parsedBody);
3084
+ }
3085
+ });
3086
+ }); };
3087
+ export var deserializeAws_restJson1UpdatePricingRuleCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3088
+ var contents, data, _a, _b;
3089
+ return __generator(this, function (_c) {
3090
+ switch (_c.label) {
3091
+ case 0:
3092
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3093
+ return [2, deserializeAws_restJson1UpdatePricingRuleCommandError(output, context)];
3094
+ }
3095
+ contents = {
3096
+ $metadata: deserializeMetadata(output),
3097
+ Arn: undefined,
3098
+ AssociatedPricingPlanCount: undefined,
3099
+ Description: undefined,
3100
+ LastModifiedTime: undefined,
3101
+ ModifierPercentage: undefined,
3102
+ Name: undefined,
3103
+ Scope: undefined,
3104
+ Service: undefined,
3105
+ Type: undefined,
3106
+ };
3107
+ _a = __expectNonNull;
3108
+ _b = __expectObject;
3109
+ return [4, parseBody(output.body, context)];
3110
+ case 1:
3111
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3112
+ if (data.Arn !== undefined && data.Arn !== null) {
3113
+ contents.Arn = __expectString(data.Arn);
3114
+ }
3115
+ if (data.AssociatedPricingPlanCount !== undefined && data.AssociatedPricingPlanCount !== null) {
3116
+ contents.AssociatedPricingPlanCount = __expectLong(data.AssociatedPricingPlanCount);
3117
+ }
3118
+ if (data.Description !== undefined && data.Description !== null) {
3119
+ contents.Description = __expectString(data.Description);
3120
+ }
3121
+ if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3122
+ contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
3123
+ }
3124
+ if (data.ModifierPercentage !== undefined && data.ModifierPercentage !== null) {
3125
+ contents.ModifierPercentage = __limitedParseDouble(data.ModifierPercentage);
3126
+ }
3127
+ if (data.Name !== undefined && data.Name !== null) {
3128
+ contents.Name = __expectString(data.Name);
3129
+ }
3130
+ if (data.Scope !== undefined && data.Scope !== null) {
3131
+ contents.Scope = __expectString(data.Scope);
3132
+ }
3133
+ if (data.Service !== undefined && data.Service !== null) {
3134
+ contents.Service = __expectString(data.Service);
3135
+ }
3136
+ if (data.Type !== undefined && data.Type !== null) {
3137
+ contents.Type = __expectString(data.Type);
3138
+ }
3139
+ return [2, Promise.resolve(contents)];
3140
+ }
3141
+ });
3142
+ }); };
3143
+ var deserializeAws_restJson1UpdatePricingRuleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3144
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
3145
+ var _c;
3146
+ return __generator(this, function (_d) {
3147
+ switch (_d.label) {
3148
+ case 0:
3149
+ _a = [__assign({}, output)];
3150
+ _c = {};
3151
+ return [4, parseBody(output.body, context)];
3152
+ case 1:
3153
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3154
+ errorCode = "UnknownError";
3155
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3156
+ _b = errorCode;
3157
+ switch (_b) {
3158
+ case "AccessDeniedException": return [3, 2];
3159
+ case "com.amazonaws.billingconductor#AccessDeniedException": return [3, 2];
3160
+ case "ConflictException": return [3, 4];
3161
+ case "com.amazonaws.billingconductor#ConflictException": return [3, 4];
3162
+ case "InternalServerException": return [3, 6];
3163
+ case "com.amazonaws.billingconductor#InternalServerException": return [3, 6];
3164
+ case "ResourceNotFoundException": return [3, 8];
3165
+ case "com.amazonaws.billingconductor#ResourceNotFoundException": return [3, 8];
3166
+ case "ThrottlingException": return [3, 10];
3167
+ case "com.amazonaws.billingconductor#ThrottlingException": return [3, 10];
3168
+ case "ValidationException": return [3, 12];
3169
+ case "com.amazonaws.billingconductor#ValidationException": return [3, 12];
3170
+ }
3171
+ return [3, 14];
3172
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
3173
+ case 3: throw _d.sent();
3174
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
3175
+ case 5: throw _d.sent();
3176
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
3177
+ case 7: throw _d.sent();
3178
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
3179
+ case 9: throw _d.sent();
3180
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
3181
+ case 11: throw _d.sent();
3182
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
3183
+ case 13: throw _d.sent();
3184
+ case 14:
3185
+ parsedBody = parsedOutput.body;
3186
+ response = new __BaseException({
3187
+ name: parsedBody.code || parsedBody.Code || errorCode,
3188
+ $fault: "client",
3189
+ $metadata: deserializeMetadata(output),
3190
+ });
3191
+ throw __decorateServiceException(response, parsedBody);
3192
+ }
3193
+ });
3194
+ }); };
3195
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3196
+ var contents, data, exception;
3197
+ return __generator(this, function (_a) {
3198
+ contents = {};
3199
+ data = parsedOutput.body;
3200
+ if (data.Message !== undefined && data.Message !== null) {
3201
+ contents.Message = __expectString(data.Message);
3202
+ }
3203
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3204
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3205
+ });
3206
+ }); };
3207
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3208
+ var contents, data, exception;
3209
+ return __generator(this, function (_a) {
3210
+ contents = {};
3211
+ data = parsedOutput.body;
3212
+ if (data.Message !== undefined && data.Message !== null) {
3213
+ contents.Message = __expectString(data.Message);
3214
+ }
3215
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3216
+ contents.ResourceId = __expectString(data.ResourceId);
3217
+ }
3218
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3219
+ contents.ResourceType = __expectString(data.ResourceType);
3220
+ }
3221
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3222
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3223
+ });
3224
+ }); };
3225
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3226
+ var contents, data, exception;
3227
+ return __generator(this, function (_a) {
3228
+ contents = {};
3229
+ if (parsedOutput.headers["retry-after"] !== undefined) {
3230
+ contents.RetryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
3231
+ }
3232
+ data = parsedOutput.body;
3233
+ if (data.Message !== undefined && data.Message !== null) {
3234
+ contents.Message = __expectString(data.Message);
3235
+ }
3236
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3237
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3238
+ });
3239
+ }); };
3240
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3241
+ var contents, data, exception;
3242
+ return __generator(this, function (_a) {
3243
+ contents = {};
3244
+ data = parsedOutput.body;
3245
+ if (data.Message !== undefined && data.Message !== null) {
3246
+ contents.Message = __expectString(data.Message);
3247
+ }
3248
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3249
+ contents.ResourceId = __expectString(data.ResourceId);
3250
+ }
3251
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3252
+ contents.ResourceType = __expectString(data.ResourceType);
3253
+ }
3254
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3255
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3256
+ });
3257
+ }); };
3258
+ var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3259
+ var contents, data, exception;
3260
+ return __generator(this, function (_a) {
3261
+ contents = {};
3262
+ data = parsedOutput.body;
3263
+ if (data.LimitCode !== undefined && data.LimitCode !== null) {
3264
+ contents.LimitCode = __expectString(data.LimitCode);
3265
+ }
3266
+ if (data.Message !== undefined && data.Message !== null) {
3267
+ contents.Message = __expectString(data.Message);
3268
+ }
3269
+ if (data.ResourceId !== undefined && data.ResourceId !== null) {
3270
+ contents.ResourceId = __expectString(data.ResourceId);
3271
+ }
3272
+ if (data.ResourceType !== undefined && data.ResourceType !== null) {
3273
+ contents.ResourceType = __expectString(data.ResourceType);
3274
+ }
3275
+ if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
3276
+ contents.ServiceCode = __expectString(data.ServiceCode);
3277
+ }
3278
+ exception = new ServiceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3279
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3280
+ });
3281
+ }); };
3282
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3283
+ var contents, data, exception;
3284
+ return __generator(this, function (_a) {
3285
+ contents = {};
3286
+ if (parsedOutput.headers["retry-after"] !== undefined) {
3287
+ contents.RetryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
3288
+ }
3289
+ data = parsedOutput.body;
3290
+ if (data.Message !== undefined && data.Message !== null) {
3291
+ contents.Message = __expectString(data.Message);
3292
+ }
3293
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3294
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3295
+ });
3296
+ }); };
3297
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3298
+ var contents, data, exception;
3299
+ return __generator(this, function (_a) {
3300
+ contents = {};
3301
+ data = parsedOutput.body;
3302
+ if (data.Fields !== undefined && data.Fields !== null) {
3303
+ contents.Fields = deserializeAws_restJson1ValidationExceptionFieldList(data.Fields, context);
3304
+ }
3305
+ if (data.Message !== undefined && data.Message !== null) {
3306
+ contents.Message = __expectString(data.Message);
3307
+ }
3308
+ if (data.Reason !== undefined && data.Reason !== null) {
3309
+ contents.Reason = __expectString(data.Reason);
3310
+ }
3311
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
3312
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
3313
+ });
3314
+ }); };
3315
+ var serializeAws_restJson1AccountGrouping = function (input, context) {
3316
+ return __assign({}, (input.LinkedAccountIds !== undefined &&
3317
+ input.LinkedAccountIds !== null && {
3318
+ LinkedAccountIds: serializeAws_restJson1AccountIdList(input.LinkedAccountIds, context),
3319
+ }));
3320
+ };
3321
+ var serializeAws_restJson1AccountIdList = function (input, context) {
3322
+ return input
3323
+ .filter(function (e) { return e != null; })
3324
+ .map(function (entry) {
3325
+ if (entry === null) {
3326
+ return null;
3327
+ }
3328
+ return entry;
3329
+ });
3330
+ };
3331
+ var serializeAws_restJson1BillingGroupArnList = function (input, context) {
3332
+ return input
3333
+ .filter(function (e) { return e != null; })
3334
+ .map(function (entry) {
3335
+ if (entry === null) {
3336
+ return null;
3337
+ }
3338
+ return entry;
3339
+ });
3340
+ };
3341
+ var serializeAws_restJson1ComputationPreference = function (input, context) {
3342
+ return __assign({}, (input.PricingPlanArn !== undefined &&
3343
+ input.PricingPlanArn !== null && { PricingPlanArn: input.PricingPlanArn }));
3344
+ };
3345
+ var serializeAws_restJson1CustomLineItemArns = function (input, context) {
3346
+ return input
3347
+ .filter(function (e) { return e != null; })
3348
+ .map(function (entry) {
3349
+ if (entry === null) {
3350
+ return null;
3351
+ }
3352
+ return entry;
3353
+ });
3354
+ };
3355
+ var serializeAws_restJson1CustomLineItemAssociationsList = function (input, context) {
3356
+ return input
3357
+ .filter(function (e) { return e != null; })
3358
+ .map(function (entry) {
3359
+ if (entry === null) {
3360
+ return null;
3361
+ }
3362
+ return entry;
3363
+ });
3364
+ };
3365
+ var serializeAws_restJson1CustomLineItemBatchAssociationsList = function (input, context) {
3366
+ return input
3367
+ .filter(function (e) { return e != null; })
3368
+ .map(function (entry) {
3369
+ if (entry === null) {
3370
+ return null;
3371
+ }
3372
+ return entry;
3373
+ });
3374
+ };
3375
+ var serializeAws_restJson1CustomLineItemBatchDisassociationsList = function (input, context) {
3376
+ return input
3377
+ .filter(function (e) { return e != null; })
3378
+ .map(function (entry) {
3379
+ if (entry === null) {
3380
+ return null;
3381
+ }
3382
+ return entry;
3383
+ });
3384
+ };
3385
+ var serializeAws_restJson1CustomLineItemBillingPeriodRange = function (input, context) {
3386
+ return __assign(__assign({}, (input.ExclusiveEndBillingPeriod !== undefined &&
3387
+ input.ExclusiveEndBillingPeriod !== null && { ExclusiveEndBillingPeriod: input.ExclusiveEndBillingPeriod })), (input.InclusiveStartBillingPeriod !== undefined &&
3388
+ input.InclusiveStartBillingPeriod !== null && { InclusiveStartBillingPeriod: input.InclusiveStartBillingPeriod }));
3389
+ };
3390
+ var serializeAws_restJson1CustomLineItemChargeDetails = function (input, context) {
3391
+ return __assign(__assign(__assign({}, (input.Flat !== undefined &&
3392
+ input.Flat !== null && { Flat: serializeAws_restJson1CustomLineItemFlatChargeDetails(input.Flat, context) })), (input.Percentage !== undefined &&
3393
+ input.Percentage !== null && {
3394
+ Percentage: serializeAws_restJson1CustomLineItemPercentageChargeDetails(input.Percentage, context),
3395
+ })), (input.Type !== undefined && input.Type !== null && { Type: input.Type }));
3396
+ };
3397
+ var serializeAws_restJson1CustomLineItemFlatChargeDetails = function (input, context) {
3398
+ return __assign({}, (input.ChargeValue !== undefined &&
3399
+ input.ChargeValue !== null && { ChargeValue: __serializeFloat(input.ChargeValue) }));
3400
+ };
3401
+ var serializeAws_restJson1CustomLineItemNameList = function (input, context) {
3402
+ return input
3403
+ .filter(function (e) { return e != null; })
3404
+ .map(function (entry) {
3405
+ if (entry === null) {
3406
+ return null;
3407
+ }
3408
+ return entry;
3409
+ });
3410
+ };
3411
+ var serializeAws_restJson1CustomLineItemPercentageChargeDetails = function (input, context) {
3412
+ return __assign(__assign({}, (input.AssociatedValues !== undefined &&
3413
+ input.AssociatedValues !== null && {
3414
+ AssociatedValues: serializeAws_restJson1CustomLineItemAssociationsList(input.AssociatedValues, context),
3415
+ })), (input.PercentageValue !== undefined &&
3416
+ input.PercentageValue !== null && { PercentageValue: __serializeFloat(input.PercentageValue) }));
3417
+ };
3418
+ var serializeAws_restJson1ListAccountAssociationsFilter = function (input, context) {
3419
+ return __assign(__assign({}, (input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId })), (input.Association !== undefined && input.Association !== null && { Association: input.Association }));
3420
+ };
3421
+ var serializeAws_restJson1ListBillingGroupCostReportsFilter = function (input, context) {
3422
+ return __assign({}, (input.BillingGroupArns !== undefined &&
3423
+ input.BillingGroupArns !== null && {
3424
+ BillingGroupArns: serializeAws_restJson1BillingGroupArnList(input.BillingGroupArns, context),
3425
+ }));
3426
+ };
3427
+ var serializeAws_restJson1ListBillingGroupsFilter = function (input, context) {
3428
+ return __assign(__assign({}, (input.Arns !== undefined &&
3429
+ input.Arns !== null && { Arns: serializeAws_restJson1BillingGroupArnList(input.Arns, context) })), (input.PricingPlan !== undefined && input.PricingPlan !== null && { PricingPlan: input.PricingPlan }));
3430
+ };
3431
+ var serializeAws_restJson1ListCustomLineItemsFilter = function (input, context) {
3432
+ return __assign(__assign(__assign({}, (input.Arns !== undefined &&
3433
+ input.Arns !== null && { Arns: serializeAws_restJson1CustomLineItemArns(input.Arns, context) })), (input.BillingGroups !== undefined &&
3434
+ input.BillingGroups !== null && {
3435
+ BillingGroups: serializeAws_restJson1BillingGroupArnList(input.BillingGroups, context),
3436
+ })), (input.Names !== undefined &&
3437
+ input.Names !== null && { Names: serializeAws_restJson1CustomLineItemNameList(input.Names, context) }));
3438
+ };
3439
+ var serializeAws_restJson1ListPricingPlansFilter = function (input, context) {
3440
+ return __assign({}, (input.Arns !== undefined &&
3441
+ input.Arns !== null && { Arns: serializeAws_restJson1PricingPlanArns(input.Arns, context) }));
3442
+ };
3443
+ var serializeAws_restJson1ListPricingRulesFilter = function (input, context) {
3444
+ return __assign({}, (input.Arns !== undefined &&
3445
+ input.Arns !== null && { Arns: serializeAws_restJson1PricingRuleArns(input.Arns, context) }));
3446
+ };
3447
+ var serializeAws_restJson1ListResourcesAssociatedToCustomLineItemFilter = function (input, context) {
3448
+ return __assign({}, (input.Relationship !== undefined && input.Relationship !== null && { Relationship: input.Relationship }));
3449
+ };
3450
+ var serializeAws_restJson1PricingPlanArns = function (input, context) {
3451
+ return input
3452
+ .filter(function (e) { return e != null; })
3453
+ .map(function (entry) {
3454
+ if (entry === null) {
3455
+ return null;
3456
+ }
3457
+ return entry;
3458
+ });
3459
+ };
3460
+ var serializeAws_restJson1PricingRuleArns = function (input, context) {
3461
+ return input
3462
+ .filter(function (e) { return e != null; })
3463
+ .map(function (entry) {
3464
+ if (entry === null) {
3465
+ return null;
3466
+ }
3467
+ return entry;
3468
+ });
3469
+ };
3470
+ var serializeAws_restJson1PricingRuleArnsInput = function (input, context) {
3471
+ return input
3472
+ .filter(function (e) { return e != null; })
3473
+ .map(function (entry) {
3474
+ if (entry === null) {
3475
+ return null;
3476
+ }
3477
+ return entry;
3478
+ });
3479
+ };
3480
+ var serializeAws_restJson1PricingRuleArnsNonEmptyInput = function (input, context) {
3481
+ return input
3482
+ .filter(function (e) { return e != null; })
3483
+ .map(function (entry) {
3484
+ if (entry === null) {
3485
+ return null;
3486
+ }
3487
+ return entry;
3488
+ });
3489
+ };
3490
+ var serializeAws_restJson1TagMap = function (input, context) {
3491
+ return Object.entries(input).reduce(function (acc, _a) {
3492
+ var _b;
3493
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
3494
+ if (value === null) {
3495
+ return acc;
3496
+ }
3497
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
3498
+ }, {});
3499
+ };
3500
+ var serializeAws_restJson1UpdateCustomLineItemChargeDetails = function (input, context) {
3501
+ return __assign(__assign({}, (input.Flat !== undefined &&
3502
+ input.Flat !== null && {
3503
+ Flat: serializeAws_restJson1UpdateCustomLineItemFlatChargeDetails(input.Flat, context),
3504
+ })), (input.Percentage !== undefined &&
3505
+ input.Percentage !== null && {
3506
+ Percentage: serializeAws_restJson1UpdateCustomLineItemPercentageChargeDetails(input.Percentage, context),
3507
+ }));
3508
+ };
3509
+ var serializeAws_restJson1UpdateCustomLineItemFlatChargeDetails = function (input, context) {
3510
+ return __assign({}, (input.ChargeValue !== undefined &&
3511
+ input.ChargeValue !== null && { ChargeValue: __serializeFloat(input.ChargeValue) }));
3512
+ };
3513
+ var serializeAws_restJson1UpdateCustomLineItemPercentageChargeDetails = function (input, context) {
3514
+ return __assign({}, (input.PercentageValue !== undefined &&
3515
+ input.PercentageValue !== null && { PercentageValue: __serializeFloat(input.PercentageValue) }));
3516
+ };
3517
+ var deserializeAws_restJson1AccountAssociationsList = function (output, context) {
3518
+ var retVal = (output || [])
3519
+ .filter(function (e) { return e != null; })
3520
+ .map(function (entry) {
3521
+ if (entry === null) {
3522
+ return null;
3523
+ }
3524
+ return deserializeAws_restJson1AccountAssociationsListElement(entry, context);
3525
+ });
3526
+ return retVal;
3527
+ };
3528
+ var deserializeAws_restJson1AccountAssociationsListElement = function (output, context) {
3529
+ return {
3530
+ AccountEmail: __expectString(output.AccountEmail),
3531
+ AccountId: __expectString(output.AccountId),
3532
+ AccountName: __expectString(output.AccountName),
3533
+ BillingGroupArn: __expectString(output.BillingGroupArn),
3534
+ };
3535
+ };
3536
+ var deserializeAws_restJson1AssociateResourceError = function (output, context) {
3537
+ return {
3538
+ Message: __expectString(output.Message),
3539
+ Reason: __expectString(output.Reason),
3540
+ };
3541
+ };
3542
+ var deserializeAws_restJson1AssociateResourceResponseElement = function (output, context) {
3543
+ return {
3544
+ Arn: __expectString(output.Arn),
3545
+ Error: output.Error !== undefined && output.Error !== null
3546
+ ? deserializeAws_restJson1AssociateResourceError(output.Error, context)
3547
+ : undefined,
3548
+ };
3549
+ };
3550
+ var deserializeAws_restJson1AssociateResourcesResponseList = function (output, context) {
3551
+ var retVal = (output || [])
3552
+ .filter(function (e) { return e != null; })
3553
+ .map(function (entry) {
3554
+ if (entry === null) {
3555
+ return null;
3556
+ }
3557
+ return deserializeAws_restJson1AssociateResourceResponseElement(entry, context);
3558
+ });
3559
+ return retVal;
3560
+ };
3561
+ var deserializeAws_restJson1BillingGroupCostReportElement = function (output, context) {
3562
+ return {
3563
+ AWSCost: __expectString(output.AWSCost),
3564
+ Arn: __expectString(output.Arn),
3565
+ Currency: __expectString(output.Currency),
3566
+ Margin: __expectString(output.Margin),
3567
+ MarginPercentage: __expectString(output.MarginPercentage),
3568
+ ProformaCost: __expectString(output.ProformaCost),
3569
+ };
3570
+ };
3571
+ var deserializeAws_restJson1BillingGroupCostReportList = function (output, context) {
3572
+ var retVal = (output || [])
3573
+ .filter(function (e) { return e != null; })
3574
+ .map(function (entry) {
3575
+ if (entry === null) {
3576
+ return null;
3577
+ }
3578
+ return deserializeAws_restJson1BillingGroupCostReportElement(entry, context);
3579
+ });
3580
+ return retVal;
3581
+ };
3582
+ var deserializeAws_restJson1BillingGroupList = function (output, context) {
3583
+ var retVal = (output || [])
3584
+ .filter(function (e) { return e != null; })
3585
+ .map(function (entry) {
3586
+ if (entry === null) {
3587
+ return null;
3588
+ }
3589
+ return deserializeAws_restJson1BillingGroupListElement(entry, context);
3590
+ });
3591
+ return retVal;
3592
+ };
3593
+ var deserializeAws_restJson1BillingGroupListElement = function (output, context) {
3594
+ return {
3595
+ Arn: __expectString(output.Arn),
3596
+ ComputationPreference: output.ComputationPreference !== undefined && output.ComputationPreference !== null
3597
+ ? deserializeAws_restJson1ComputationPreference(output.ComputationPreference, context)
3598
+ : undefined,
3599
+ CreationTime: __expectLong(output.CreationTime),
3600
+ Description: __expectString(output.Description),
3601
+ LastModifiedTime: __expectLong(output.LastModifiedTime),
3602
+ Name: __expectString(output.Name),
3603
+ PrimaryAccountId: __expectString(output.PrimaryAccountId),
3604
+ Size: __expectLong(output.Size),
3605
+ Status: __expectString(output.Status),
3606
+ StatusReason: __expectString(output.StatusReason),
3607
+ };
3608
+ };
3609
+ var deserializeAws_restJson1ComputationPreference = function (output, context) {
3610
+ return {
3611
+ PricingPlanArn: __expectString(output.PricingPlanArn),
3612
+ };
3613
+ };
3614
+ var deserializeAws_restJson1CustomLineItemList = function (output, context) {
3615
+ var retVal = (output || [])
3616
+ .filter(function (e) { return e != null; })
3617
+ .map(function (entry) {
3618
+ if (entry === null) {
3619
+ return null;
3620
+ }
3621
+ return deserializeAws_restJson1CustomLineItemListElement(entry, context);
3622
+ });
3623
+ return retVal;
3624
+ };
3625
+ var deserializeAws_restJson1CustomLineItemListElement = function (output, context) {
3626
+ return {
3627
+ Arn: __expectString(output.Arn),
3628
+ AssociationSize: __expectLong(output.AssociationSize),
3629
+ BillingGroupArn: __expectString(output.BillingGroupArn),
3630
+ ChargeDetails: output.ChargeDetails !== undefined && output.ChargeDetails !== null
3631
+ ? deserializeAws_restJson1ListCustomLineItemChargeDetails(output.ChargeDetails, context)
3632
+ : undefined,
3633
+ CreationTime: __expectLong(output.CreationTime),
3634
+ CurrencyCode: __expectString(output.CurrencyCode),
3635
+ Description: __expectString(output.Description),
3636
+ LastModifiedTime: __expectLong(output.LastModifiedTime),
3637
+ Name: __expectString(output.Name),
3638
+ ProductCode: __expectString(output.ProductCode),
3639
+ };
3640
+ };
3641
+ var deserializeAws_restJson1DisassociateResourceResponseElement = function (output, context) {
3642
+ return {
3643
+ Arn: __expectString(output.Arn),
3644
+ Error: output.Error !== undefined && output.Error !== null
3645
+ ? deserializeAws_restJson1AssociateResourceError(output.Error, context)
3646
+ : undefined,
3647
+ };
3648
+ };
3649
+ var deserializeAws_restJson1DisassociateResourcesResponseList = function (output, context) {
3650
+ var retVal = (output || [])
3651
+ .filter(function (e) { return e != null; })
3652
+ .map(function (entry) {
3653
+ if (entry === null) {
3654
+ return null;
3655
+ }
3656
+ return deserializeAws_restJson1DisassociateResourceResponseElement(entry, context);
3657
+ });
3658
+ return retVal;
3659
+ };
3660
+ var deserializeAws_restJson1ListCustomLineItemChargeDetails = function (output, context) {
3661
+ return {
3662
+ Flat: output.Flat !== undefined && output.Flat !== null
3663
+ ? deserializeAws_restJson1ListCustomLineItemFlatChargeDetails(output.Flat, context)
3664
+ : undefined,
3665
+ Percentage: output.Percentage !== undefined && output.Percentage !== null
3666
+ ? deserializeAws_restJson1ListCustomLineItemPercentageChargeDetails(output.Percentage, context)
3667
+ : undefined,
3668
+ Type: __expectString(output.Type),
3669
+ };
3670
+ };
3671
+ var deserializeAws_restJson1ListCustomLineItemFlatChargeDetails = function (output, context) {
3672
+ return {
3673
+ ChargeValue: __limitedParseDouble(output.ChargeValue),
3674
+ };
3675
+ };
3676
+ var deserializeAws_restJson1ListCustomLineItemPercentageChargeDetails = function (output, context) {
3677
+ return {
3678
+ PercentageValue: __limitedParseDouble(output.PercentageValue),
3679
+ };
3680
+ };
3681
+ var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemResponseElement = function (output, context) {
3682
+ return {
3683
+ Arn: __expectString(output.Arn),
3684
+ Relationship: __expectString(output.Relationship),
3685
+ };
3686
+ };
3687
+ var deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemResponseList = function (output, context) {
3688
+ var retVal = (output || [])
3689
+ .filter(function (e) { return e != null; })
3690
+ .map(function (entry) {
3691
+ if (entry === null) {
3692
+ return null;
3693
+ }
3694
+ return deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemResponseElement(entry, context);
3695
+ });
3696
+ return retVal;
3697
+ };
3698
+ var deserializeAws_restJson1PricingPlanArns = function (output, context) {
3699
+ var retVal = (output || [])
3700
+ .filter(function (e) { return e != null; })
3701
+ .map(function (entry) {
3702
+ if (entry === null) {
3703
+ return null;
3704
+ }
3705
+ return __expectString(entry);
3706
+ });
3707
+ return retVal;
3708
+ };
3709
+ var deserializeAws_restJson1PricingPlanList = function (output, context) {
3710
+ var retVal = (output || [])
3711
+ .filter(function (e) { return e != null; })
3712
+ .map(function (entry) {
3713
+ if (entry === null) {
3714
+ return null;
3715
+ }
3716
+ return deserializeAws_restJson1PricingPlanListElement(entry, context);
3717
+ });
3718
+ return retVal;
3719
+ };
3720
+ var deserializeAws_restJson1PricingPlanListElement = function (output, context) {
3721
+ return {
3722
+ Arn: __expectString(output.Arn),
3723
+ CreationTime: __expectLong(output.CreationTime),
3724
+ Description: __expectString(output.Description),
3725
+ LastModifiedTime: __expectLong(output.LastModifiedTime),
3726
+ Name: __expectString(output.Name),
3727
+ Size: __expectLong(output.Size),
3728
+ };
3729
+ };
3730
+ var deserializeAws_restJson1PricingRuleArns = function (output, context) {
3731
+ var retVal = (output || [])
3732
+ .filter(function (e) { return e != null; })
3733
+ .map(function (entry) {
3734
+ if (entry === null) {
3735
+ return null;
3736
+ }
3737
+ return __expectString(entry);
3738
+ });
3739
+ return retVal;
3740
+ };
3741
+ var deserializeAws_restJson1PricingRuleList = function (output, context) {
3742
+ var retVal = (output || [])
3743
+ .filter(function (e) { return e != null; })
3744
+ .map(function (entry) {
3745
+ if (entry === null) {
3746
+ return null;
3747
+ }
3748
+ return deserializeAws_restJson1PricingRuleListElement(entry, context);
3749
+ });
3750
+ return retVal;
3751
+ };
3752
+ var deserializeAws_restJson1PricingRuleListElement = function (output, context) {
3753
+ return {
3754
+ Arn: __expectString(output.Arn),
3755
+ AssociatedPricingPlanCount: __expectLong(output.AssociatedPricingPlanCount),
3756
+ CreationTime: __expectLong(output.CreationTime),
3757
+ Description: __expectString(output.Description),
3758
+ LastModifiedTime: __expectLong(output.LastModifiedTime),
3759
+ ModifierPercentage: __limitedParseDouble(output.ModifierPercentage),
3760
+ Name: __expectString(output.Name),
3761
+ Scope: __expectString(output.Scope),
3762
+ Service: __expectString(output.Service),
3763
+ Type: __expectString(output.Type),
3764
+ };
3765
+ };
3766
+ var deserializeAws_restJson1TagMap = function (output, context) {
3767
+ return Object.entries(output).reduce(function (acc, _a) {
3768
+ var _b;
3769
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
3770
+ if (value === null) {
3771
+ return acc;
3772
+ }
3773
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
3774
+ }, {});
3775
+ };
3776
+ var deserializeAws_restJson1ValidationExceptionField = function (output, context) {
3777
+ return {
3778
+ Message: __expectString(output.Message),
3779
+ Name: __expectString(output.Name),
3780
+ };
3781
+ };
3782
+ var deserializeAws_restJson1ValidationExceptionFieldList = function (output, context) {
3783
+ var retVal = (output || [])
3784
+ .filter(function (e) { return e != null; })
3785
+ .map(function (entry) {
3786
+ if (entry === null) {
3787
+ return null;
3788
+ }
3789
+ return deserializeAws_restJson1ValidationExceptionField(entry, context);
3790
+ });
3791
+ return retVal;
3792
+ };
3793
+ var deserializeMetadata = function (output) {
3794
+ var _a;
3795
+ return ({
3796
+ httpStatusCode: output.statusCode,
3797
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
3798
+ extendedRequestId: output.headers["x-amz-id-2"],
3799
+ cfId: output.headers["x-amz-cf-id"],
3800
+ });
3801
+ };
3802
+ var collectBody = function (streamBody, context) {
3803
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
3804
+ if (streamBody instanceof Uint8Array) {
3805
+ return Promise.resolve(streamBody);
3806
+ }
3807
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3808
+ };
3809
+ var collectBodyString = function (streamBody, context) {
3810
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
3811
+ };
3812
+ var isSerializableHeaderValue = function (value) {
3813
+ return value !== undefined &&
3814
+ value !== null &&
3815
+ value !== "" &&
3816
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
3817
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
3818
+ };
3819
+ var parseBody = function (streamBody, context) {
3820
+ return collectBodyString(streamBody, context).then(function (encoded) {
3821
+ if (encoded.length) {
3822
+ return JSON.parse(encoded);
3823
+ }
3824
+ return {};
3825
+ });
3826
+ };
3827
+ var loadRestJsonErrorCode = function (output, data) {
3828
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
3829
+ var sanitizeErrorCode = function (rawValue) {
3830
+ var cleanValue = rawValue;
3831
+ if (cleanValue.indexOf(":") >= 0) {
3832
+ cleanValue = cleanValue.split(":")[0];
3833
+ }
3834
+ if (cleanValue.indexOf("#") >= 0) {
3835
+ cleanValue = cleanValue.split("#")[1];
3836
+ }
3837
+ return cleanValue;
3838
+ };
3839
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
3840
+ if (headerKey !== undefined) {
3841
+ return sanitizeErrorCode(output.headers[headerKey]);
3842
+ }
3843
+ if (data.code !== undefined) {
3844
+ return sanitizeErrorCode(data.code);
3845
+ }
3846
+ if (data["__type"] !== undefined) {
3847
+ return sanitizeErrorCode(data["__type"]);
3848
+ }
3849
+ return "";
3850
+ };