@aws-sdk/client-billingconductor 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { BillingconductorServiceException as __BaseException } from "../models/BillingconductorServiceException";
4
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
5
  export const se_AssociateAccountsCommand = async (input, context) => {
@@ -9,10 +9,10 @@ export const se_AssociateAccountsCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associate-accounts";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.AccountIds != null && { AccountIds: se_AccountIdList(input.AccountIds, context) }),
14
- ...(input.Arn != null && { Arn: input.Arn }),
15
- });
12
+ body = JSON.stringify(take(input, {
13
+ AccountIds: (_) => _json(_),
14
+ Arn: [],
15
+ }));
16
16
  return new __HttpRequest({
17
17
  protocol,
18
18
  hostname,
@@ -30,12 +30,10 @@ export const se_AssociatePricingRulesCommand = async (input, context) => {
30
30
  };
31
31
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associate-pricing-rules";
32
32
  let body;
33
- body = JSON.stringify({
34
- ...(input.Arn != null && { Arn: input.Arn }),
35
- ...(input.PricingRuleArns != null && {
36
- PricingRuleArns: se_PricingRuleArnsNonEmptyInput(input.PricingRuleArns, context),
37
- }),
38
- });
33
+ body = JSON.stringify(take(input, {
34
+ Arn: [],
35
+ PricingRuleArns: (_) => _json(_),
36
+ }));
39
37
  return new __HttpRequest({
40
38
  protocol,
41
39
  hostname,
@@ -54,15 +52,11 @@ export const se_BatchAssociateResourcesToCustomLineItemCommand = async (input, c
54
52
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
55
53
  "/batch-associate-resources-to-custom-line-item";
56
54
  let body;
57
- body = JSON.stringify({
58
- ...(input.BillingPeriodRange != null && {
59
- BillingPeriodRange: se_CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
60
- }),
61
- ...(input.ResourceArns != null && {
62
- ResourceArns: se_CustomLineItemBatchAssociationsList(input.ResourceArns, context),
63
- }),
64
- ...(input.TargetArn != null && { TargetArn: input.TargetArn }),
65
- });
55
+ body = JSON.stringify(take(input, {
56
+ BillingPeriodRange: (_) => _json(_),
57
+ ResourceArns: (_) => _json(_),
58
+ TargetArn: [],
59
+ }));
66
60
  return new __HttpRequest({
67
61
  protocol,
68
62
  hostname,
@@ -81,15 +75,11 @@ export const se_BatchDisassociateResourcesFromCustomLineItemCommand = async (inp
81
75
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
82
76
  "/batch-disassociate-resources-from-custom-line-item";
83
77
  let body;
84
- body = JSON.stringify({
85
- ...(input.BillingPeriodRange != null && {
86
- BillingPeriodRange: se_CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
87
- }),
88
- ...(input.ResourceArns != null && {
89
- ResourceArns: se_CustomLineItemBatchDisassociationsList(input.ResourceArns, context),
90
- }),
91
- ...(input.TargetArn != null && { TargetArn: input.TargetArn }),
92
- });
78
+ body = JSON.stringify(take(input, {
79
+ BillingPeriodRange: (_) => _json(_),
80
+ ResourceArns: (_) => _json(_),
81
+ TargetArn: [],
82
+ }));
93
83
  return new __HttpRequest({
94
84
  protocol,
95
85
  hostname,
@@ -108,16 +98,14 @@ export const se_CreateBillingGroupCommand = async (input, context) => {
108
98
  });
109
99
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/create-billing-group";
110
100
  let body;
111
- body = JSON.stringify({
112
- ...(input.AccountGrouping != null && { AccountGrouping: se_AccountGrouping(input.AccountGrouping, context) }),
113
- ...(input.ComputationPreference != null && {
114
- ComputationPreference: se_ComputationPreference(input.ComputationPreference, context),
115
- }),
116
- ...(input.Description != null && { Description: input.Description }),
117
- ...(input.Name != null && { Name: input.Name }),
118
- ...(input.PrimaryAccountId != null && { PrimaryAccountId: input.PrimaryAccountId }),
119
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
120
- });
101
+ body = JSON.stringify(take(input, {
102
+ AccountGrouping: (_) => _json(_),
103
+ ComputationPreference: (_) => _json(_),
104
+ Description: [],
105
+ Name: [],
106
+ PrimaryAccountId: [],
107
+ Tags: (_) => _json(_),
108
+ }));
121
109
  return new __HttpRequest({
122
110
  protocol,
123
111
  hostname,
@@ -136,16 +124,14 @@ export const se_CreateCustomLineItemCommand = async (input, context) => {
136
124
  });
137
125
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/create-custom-line-item";
138
126
  let body;
139
- body = JSON.stringify({
140
- ...(input.BillingGroupArn != null && { BillingGroupArn: input.BillingGroupArn }),
141
- ...(input.BillingPeriodRange != null && {
142
- BillingPeriodRange: se_CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
143
- }),
144
- ...(input.ChargeDetails != null && { ChargeDetails: se_CustomLineItemChargeDetails(input.ChargeDetails, context) }),
145
- ...(input.Description != null && { Description: input.Description }),
146
- ...(input.Name != null && { Name: input.Name }),
147
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
148
- });
127
+ body = JSON.stringify(take(input, {
128
+ BillingGroupArn: [],
129
+ BillingPeriodRange: (_) => _json(_),
130
+ ChargeDetails: (_) => se_CustomLineItemChargeDetails(_, context),
131
+ Description: [],
132
+ Name: [],
133
+ Tags: (_) => _json(_),
134
+ }));
149
135
  return new __HttpRequest({
150
136
  protocol,
151
137
  hostname,
@@ -164,12 +150,12 @@ export const se_CreatePricingPlanCommand = async (input, context) => {
164
150
  });
165
151
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/create-pricing-plan";
166
152
  let body;
167
- body = JSON.stringify({
168
- ...(input.Description != null && { Description: input.Description }),
169
- ...(input.Name != null && { Name: input.Name }),
170
- ...(input.PricingRuleArns != null && { PricingRuleArns: se_PricingRuleArnsInput(input.PricingRuleArns, context) }),
171
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
172
- });
153
+ body = JSON.stringify(take(input, {
154
+ Description: [],
155
+ Name: [],
156
+ PricingRuleArns: (_) => _json(_),
157
+ Tags: (_) => _json(_),
158
+ }));
173
159
  return new __HttpRequest({
174
160
  protocol,
175
161
  hostname,
@@ -188,19 +174,19 @@ export const se_CreatePricingRuleCommand = async (input, context) => {
188
174
  });
189
175
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/create-pricing-rule";
190
176
  let body;
191
- body = JSON.stringify({
192
- ...(input.BillingEntity != null && { BillingEntity: input.BillingEntity }),
193
- ...(input.Description != null && { Description: input.Description }),
194
- ...(input.ModifierPercentage != null && { ModifierPercentage: __serializeFloat(input.ModifierPercentage) }),
195
- ...(input.Name != null && { Name: input.Name }),
196
- ...(input.Operation != null && { Operation: input.Operation }),
197
- ...(input.Scope != null && { Scope: input.Scope }),
198
- ...(input.Service != null && { Service: input.Service }),
199
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
200
- ...(input.Tiering != null && { Tiering: se_CreateTieringInput(input.Tiering, context) }),
201
- ...(input.Type != null && { Type: input.Type }),
202
- ...(input.UsageType != null && { UsageType: input.UsageType }),
203
- });
177
+ body = JSON.stringify(take(input, {
178
+ BillingEntity: [],
179
+ Description: [],
180
+ ModifierPercentage: (_) => __serializeFloat(_),
181
+ Name: [],
182
+ Operation: [],
183
+ Scope: [],
184
+ Service: [],
185
+ Tags: (_) => _json(_),
186
+ Tiering: (_) => _json(_),
187
+ Type: [],
188
+ UsageType: [],
189
+ }));
204
190
  return new __HttpRequest({
205
191
  protocol,
206
192
  hostname,
@@ -218,9 +204,9 @@ export const se_DeleteBillingGroupCommand = async (input, context) => {
218
204
  };
219
205
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/delete-billing-group";
220
206
  let body;
221
- body = JSON.stringify({
222
- ...(input.Arn != null && { Arn: input.Arn }),
223
- });
207
+ body = JSON.stringify(take(input, {
208
+ Arn: [],
209
+ }));
224
210
  return new __HttpRequest({
225
211
  protocol,
226
212
  hostname,
@@ -238,12 +224,10 @@ export const se_DeleteCustomLineItemCommand = async (input, context) => {
238
224
  };
239
225
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/delete-custom-line-item";
240
226
  let body;
241
- body = JSON.stringify({
242
- ...(input.Arn != null && { Arn: input.Arn }),
243
- ...(input.BillingPeriodRange != null && {
244
- BillingPeriodRange: se_CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
245
- }),
246
- });
227
+ body = JSON.stringify(take(input, {
228
+ Arn: [],
229
+ BillingPeriodRange: (_) => _json(_),
230
+ }));
247
231
  return new __HttpRequest({
248
232
  protocol,
249
233
  hostname,
@@ -261,9 +245,9 @@ export const se_DeletePricingPlanCommand = async (input, context) => {
261
245
  };
262
246
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/delete-pricing-plan";
263
247
  let body;
264
- body = JSON.stringify({
265
- ...(input.Arn != null && { Arn: input.Arn }),
266
- });
248
+ body = JSON.stringify(take(input, {
249
+ Arn: [],
250
+ }));
267
251
  return new __HttpRequest({
268
252
  protocol,
269
253
  hostname,
@@ -281,9 +265,9 @@ export const se_DeletePricingRuleCommand = async (input, context) => {
281
265
  };
282
266
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/delete-pricing-rule";
283
267
  let body;
284
- body = JSON.stringify({
285
- ...(input.Arn != null && { Arn: input.Arn }),
286
- });
268
+ body = JSON.stringify(take(input, {
269
+ Arn: [],
270
+ }));
287
271
  return new __HttpRequest({
288
272
  protocol,
289
273
  hostname,
@@ -301,10 +285,10 @@ export const se_DisassociateAccountsCommand = async (input, context) => {
301
285
  };
302
286
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociate-accounts";
303
287
  let body;
304
- body = JSON.stringify({
305
- ...(input.AccountIds != null && { AccountIds: se_AccountIdList(input.AccountIds, context) }),
306
- ...(input.Arn != null && { Arn: input.Arn }),
307
- });
288
+ body = JSON.stringify(take(input, {
289
+ AccountIds: (_) => _json(_),
290
+ Arn: [],
291
+ }));
308
292
  return new __HttpRequest({
309
293
  protocol,
310
294
  hostname,
@@ -322,12 +306,10 @@ export const se_DisassociatePricingRulesCommand = async (input, context) => {
322
306
  };
323
307
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disassociate-pricing-rules";
324
308
  let body;
325
- body = JSON.stringify({
326
- ...(input.Arn != null && { Arn: input.Arn }),
327
- ...(input.PricingRuleArns != null && {
328
- PricingRuleArns: se_PricingRuleArnsNonEmptyInput(input.PricingRuleArns, context),
329
- }),
330
- });
309
+ body = JSON.stringify(take(input, {
310
+ Arn: [],
311
+ PricingRuleArns: (_) => _json(_),
312
+ }));
331
313
  return new __HttpRequest({
332
314
  protocol,
333
315
  hostname,
@@ -345,11 +327,11 @@ export const se_ListAccountAssociationsCommand = async (input, context) => {
345
327
  };
346
328
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-account-associations";
347
329
  let body;
348
- body = JSON.stringify({
349
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
350
- ...(input.Filters != null && { Filters: se_ListAccountAssociationsFilter(input.Filters, context) }),
351
- ...(input.NextToken != null && { NextToken: input.NextToken }),
352
- });
330
+ body = JSON.stringify(take(input, {
331
+ BillingPeriod: [],
332
+ Filters: (_) => _json(_),
333
+ NextToken: [],
334
+ }));
353
335
  return new __HttpRequest({
354
336
  protocol,
355
337
  hostname,
@@ -367,12 +349,12 @@ export const se_ListBillingGroupCostReportsCommand = async (input, context) => {
367
349
  };
368
350
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-billing-group-cost-reports";
369
351
  let body;
370
- body = JSON.stringify({
371
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
372
- ...(input.Filters != null && { Filters: se_ListBillingGroupCostReportsFilter(input.Filters, context) }),
373
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
374
- ...(input.NextToken != null && { NextToken: input.NextToken }),
375
- });
352
+ body = JSON.stringify(take(input, {
353
+ BillingPeriod: [],
354
+ Filters: (_) => _json(_),
355
+ MaxResults: [],
356
+ NextToken: [],
357
+ }));
376
358
  return new __HttpRequest({
377
359
  protocol,
378
360
  hostname,
@@ -390,12 +372,12 @@ export const se_ListBillingGroupsCommand = async (input, context) => {
390
372
  };
391
373
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-billing-groups";
392
374
  let body;
393
- body = JSON.stringify({
394
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
395
- ...(input.Filters != null && { Filters: se_ListBillingGroupsFilter(input.Filters, context) }),
396
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
397
- ...(input.NextToken != null && { NextToken: input.NextToken }),
398
- });
375
+ body = JSON.stringify(take(input, {
376
+ BillingPeriod: [],
377
+ Filters: (_) => _json(_),
378
+ MaxResults: [],
379
+ NextToken: [],
380
+ }));
399
381
  return new __HttpRequest({
400
382
  protocol,
401
383
  hostname,
@@ -413,12 +395,12 @@ export const se_ListCustomLineItemsCommand = async (input, context) => {
413
395
  };
414
396
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-custom-line-items";
415
397
  let body;
416
- body = JSON.stringify({
417
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
418
- ...(input.Filters != null && { Filters: se_ListCustomLineItemsFilter(input.Filters, context) }),
419
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
420
- ...(input.NextToken != null && { NextToken: input.NextToken }),
421
- });
398
+ body = JSON.stringify(take(input, {
399
+ BillingPeriod: [],
400
+ Filters: (_) => _json(_),
401
+ MaxResults: [],
402
+ NextToken: [],
403
+ }));
422
404
  return new __HttpRequest({
423
405
  protocol,
424
406
  hostname,
@@ -436,12 +418,12 @@ export const se_ListCustomLineItemVersionsCommand = async (input, context) => {
436
418
  };
437
419
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-custom-line-item-versions";
438
420
  let body;
439
- body = JSON.stringify({
440
- ...(input.Arn != null && { Arn: input.Arn }),
441
- ...(input.Filters != null && { Filters: se_ListCustomLineItemVersionsFilter(input.Filters, context) }),
442
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
443
- ...(input.NextToken != null && { NextToken: input.NextToken }),
444
- });
421
+ body = JSON.stringify(take(input, {
422
+ Arn: [],
423
+ Filters: (_) => _json(_),
424
+ MaxResults: [],
425
+ NextToken: [],
426
+ }));
445
427
  return new __HttpRequest({
446
428
  protocol,
447
429
  hostname,
@@ -459,12 +441,12 @@ export const se_ListPricingPlansCommand = async (input, context) => {
459
441
  };
460
442
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-pricing-plans";
461
443
  let body;
462
- body = JSON.stringify({
463
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
464
- ...(input.Filters != null && { Filters: se_ListPricingPlansFilter(input.Filters, context) }),
465
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
466
- ...(input.NextToken != null && { NextToken: input.NextToken }),
467
- });
444
+ body = JSON.stringify(take(input, {
445
+ BillingPeriod: [],
446
+ Filters: (_) => _json(_),
447
+ MaxResults: [],
448
+ NextToken: [],
449
+ }));
468
450
  return new __HttpRequest({
469
451
  protocol,
470
452
  hostname,
@@ -483,12 +465,12 @@ export const se_ListPricingPlansAssociatedWithPricingRuleCommand = async (input,
483
465
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
484
466
  "/list-pricing-plans-associated-with-pricing-rule";
485
467
  let body;
486
- body = JSON.stringify({
487
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
488
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
489
- ...(input.NextToken != null && { NextToken: input.NextToken }),
490
- ...(input.PricingRuleArn != null && { PricingRuleArn: input.PricingRuleArn }),
491
- });
468
+ body = JSON.stringify(take(input, {
469
+ BillingPeriod: [],
470
+ MaxResults: [],
471
+ NextToken: [],
472
+ PricingRuleArn: [],
473
+ }));
492
474
  return new __HttpRequest({
493
475
  protocol,
494
476
  hostname,
@@ -506,12 +488,12 @@ export const se_ListPricingRulesCommand = async (input, context) => {
506
488
  };
507
489
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-pricing-rules";
508
490
  let body;
509
- body = JSON.stringify({
510
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
511
- ...(input.Filters != null && { Filters: se_ListPricingRulesFilter(input.Filters, context) }),
512
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
513
- ...(input.NextToken != null && { NextToken: input.NextToken }),
514
- });
491
+ body = JSON.stringify(take(input, {
492
+ BillingPeriod: [],
493
+ Filters: (_) => _json(_),
494
+ MaxResults: [],
495
+ NextToken: [],
496
+ }));
515
497
  return new __HttpRequest({
516
498
  protocol,
517
499
  hostname,
@@ -530,12 +512,12 @@ export const se_ListPricingRulesAssociatedToPricingPlanCommand = async (input, c
530
512
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
531
513
  "/list-pricing-rules-associated-to-pricing-plan";
532
514
  let body;
533
- body = JSON.stringify({
534
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
535
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
536
- ...(input.NextToken != null && { NextToken: input.NextToken }),
537
- ...(input.PricingPlanArn != null && { PricingPlanArn: input.PricingPlanArn }),
538
- });
515
+ body = JSON.stringify(take(input, {
516
+ BillingPeriod: [],
517
+ MaxResults: [],
518
+ NextToken: [],
519
+ PricingPlanArn: [],
520
+ }));
539
521
  return new __HttpRequest({
540
522
  protocol,
541
523
  hostname,
@@ -554,13 +536,13 @@ export const se_ListResourcesAssociatedToCustomLineItemCommand = async (input, c
554
536
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
555
537
  "/list-resources-associated-to-custom-line-item";
556
538
  let body;
557
- body = JSON.stringify({
558
- ...(input.Arn != null && { Arn: input.Arn }),
559
- ...(input.BillingPeriod != null && { BillingPeriod: input.BillingPeriod }),
560
- ...(input.Filters != null && { Filters: se_ListResourcesAssociatedToCustomLineItemFilter(input.Filters, context) }),
561
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
562
- ...(input.NextToken != null && { NextToken: input.NextToken }),
563
- });
539
+ body = JSON.stringify(take(input, {
540
+ Arn: [],
541
+ BillingPeriod: [],
542
+ Filters: (_) => _json(_),
543
+ MaxResults: [],
544
+ NextToken: [],
545
+ }));
564
546
  return new __HttpRequest({
565
547
  protocol,
566
548
  hostname,
@@ -595,9 +577,9 @@ export const se_TagResourceCommand = async (input, context) => {
595
577
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
596
578
  resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
597
579
  let body;
598
- body = JSON.stringify({
599
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
600
- });
580
+ body = JSON.stringify(take(input, {
581
+ Tags: (_) => _json(_),
582
+ }));
601
583
  return new __HttpRequest({
602
584
  protocol,
603
585
  hostname,
@@ -638,15 +620,13 @@ export const se_UpdateBillingGroupCommand = async (input, context) => {
638
620
  };
639
621
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-billing-group";
640
622
  let body;
641
- body = JSON.stringify({
642
- ...(input.Arn != null && { Arn: input.Arn }),
643
- ...(input.ComputationPreference != null && {
644
- ComputationPreference: se_ComputationPreference(input.ComputationPreference, context),
645
- }),
646
- ...(input.Description != null && { Description: input.Description }),
647
- ...(input.Name != null && { Name: input.Name }),
648
- ...(input.Status != null && { Status: input.Status }),
649
- });
623
+ body = JSON.stringify(take(input, {
624
+ Arn: [],
625
+ ComputationPreference: (_) => _json(_),
626
+ Description: [],
627
+ Name: [],
628
+ Status: [],
629
+ }));
650
630
  return new __HttpRequest({
651
631
  protocol,
652
632
  hostname,
@@ -664,17 +644,13 @@ export const se_UpdateCustomLineItemCommand = async (input, context) => {
664
644
  };
665
645
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-custom-line-item";
666
646
  let body;
667
- body = JSON.stringify({
668
- ...(input.Arn != null && { Arn: input.Arn }),
669
- ...(input.BillingPeriodRange != null && {
670
- BillingPeriodRange: se_CustomLineItemBillingPeriodRange(input.BillingPeriodRange, context),
671
- }),
672
- ...(input.ChargeDetails != null && {
673
- ChargeDetails: se_UpdateCustomLineItemChargeDetails(input.ChargeDetails, context),
674
- }),
675
- ...(input.Description != null && { Description: input.Description }),
676
- ...(input.Name != null && { Name: input.Name }),
677
- });
647
+ body = JSON.stringify(take(input, {
648
+ Arn: [],
649
+ BillingPeriodRange: (_) => _json(_),
650
+ ChargeDetails: (_) => se_UpdateCustomLineItemChargeDetails(_, context),
651
+ Description: [],
652
+ Name: [],
653
+ }));
678
654
  return new __HttpRequest({
679
655
  protocol,
680
656
  hostname,
@@ -692,11 +668,11 @@ export const se_UpdatePricingPlanCommand = async (input, context) => {
692
668
  };
693
669
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-pricing-plan";
694
670
  let body;
695
- body = JSON.stringify({
696
- ...(input.Arn != null && { Arn: input.Arn }),
697
- ...(input.Description != null && { Description: input.Description }),
698
- ...(input.Name != null && { Name: input.Name }),
699
- });
671
+ body = JSON.stringify(take(input, {
672
+ Arn: [],
673
+ Description: [],
674
+ Name: [],
675
+ }));
700
676
  return new __HttpRequest({
701
677
  protocol,
702
678
  hostname,
@@ -714,14 +690,14 @@ export const se_UpdatePricingRuleCommand = async (input, context) => {
714
690
  };
715
691
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/update-pricing-rule";
716
692
  let body;
717
- body = JSON.stringify({
718
- ...(input.Arn != null && { Arn: input.Arn }),
719
- ...(input.Description != null && { Description: input.Description }),
720
- ...(input.ModifierPercentage != null && { ModifierPercentage: __serializeFloat(input.ModifierPercentage) }),
721
- ...(input.Name != null && { Name: input.Name }),
722
- ...(input.Tiering != null && { Tiering: se_UpdateTieringInput(input.Tiering, context) }),
723
- ...(input.Type != null && { Type: input.Type }),
724
- });
693
+ body = JSON.stringify(take(input, {
694
+ Arn: [],
695
+ Description: [],
696
+ ModifierPercentage: (_) => __serializeFloat(_),
697
+ Name: [],
698
+ Tiering: (_) => _json(_),
699
+ Type: [],
700
+ }));
725
701
  return new __HttpRequest({
726
702
  protocol,
727
703
  hostname,
@@ -740,9 +716,10 @@ export const de_AssociateAccountsCommand = async (output, context) => {
740
716
  $metadata: deserializeMetadata(output),
741
717
  });
742
718
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
743
- if (data.Arn != null) {
744
- contents.Arn = __expectString(data.Arn);
745
- }
719
+ const doc = take(data, {
720
+ Arn: __expectString,
721
+ });
722
+ Object.assign(contents, doc);
746
723
  return contents;
747
724
  };
748
725
  const de_AssociateAccountsCommandError = async (output, context) => {
@@ -775,10 +752,9 @@ const de_AssociateAccountsCommandError = async (output, context) => {
775
752
  throw await de_ValidationExceptionRes(parsedOutput, context);
776
753
  default:
777
754
  const parsedBody = parsedOutput.body;
778
- throwDefaultError({
755
+ return throwDefaultError({
779
756
  output,
780
757
  parsedBody,
781
- exceptionCtor: __BaseException,
782
758
  errorCode,
783
759
  });
784
760
  }
@@ -791,9 +767,10 @@ export const de_AssociatePricingRulesCommand = async (output, context) => {
791
767
  $metadata: deserializeMetadata(output),
792
768
  });
793
769
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
794
- if (data.Arn != null) {
795
- contents.Arn = __expectString(data.Arn);
796
- }
770
+ const doc = take(data, {
771
+ Arn: __expectString,
772
+ });
773
+ Object.assign(contents, doc);
797
774
  return contents;
798
775
  };
799
776
  const de_AssociatePricingRulesCommandError = async (output, context) => {
@@ -826,10 +803,9 @@ const de_AssociatePricingRulesCommandError = async (output, context) => {
826
803
  throw await de_ValidationExceptionRes(parsedOutput, context);
827
804
  default:
828
805
  const parsedBody = parsedOutput.body;
829
- throwDefaultError({
806
+ return throwDefaultError({
830
807
  output,
831
808
  parsedBody,
832
- exceptionCtor: __BaseException,
833
809
  errorCode,
834
810
  });
835
811
  }
@@ -842,12 +818,11 @@ export const de_BatchAssociateResourcesToCustomLineItemCommand = async (output,
842
818
  $metadata: deserializeMetadata(output),
843
819
  });
844
820
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
845
- if (data.FailedAssociatedResources != null) {
846
- contents.FailedAssociatedResources = de_AssociateResourcesResponseList(data.FailedAssociatedResources, context);
847
- }
848
- if (data.SuccessfullyAssociatedResources != null) {
849
- contents.SuccessfullyAssociatedResources = de_AssociateResourcesResponseList(data.SuccessfullyAssociatedResources, context);
850
- }
821
+ const doc = take(data, {
822
+ FailedAssociatedResources: _json,
823
+ SuccessfullyAssociatedResources: _json,
824
+ });
825
+ Object.assign(contents, doc);
851
826
  return contents;
852
827
  };
853
828
  const de_BatchAssociateResourcesToCustomLineItemCommandError = async (output, context) => {
@@ -880,10 +855,9 @@ const de_BatchAssociateResourcesToCustomLineItemCommandError = async (output, co
880
855
  throw await de_ValidationExceptionRes(parsedOutput, context);
881
856
  default:
882
857
  const parsedBody = parsedOutput.body;
883
- throwDefaultError({
858
+ return throwDefaultError({
884
859
  output,
885
860
  parsedBody,
886
- exceptionCtor: __BaseException,
887
861
  errorCode,
888
862
  });
889
863
  }
@@ -896,12 +870,11 @@ export const de_BatchDisassociateResourcesFromCustomLineItemCommand = async (out
896
870
  $metadata: deserializeMetadata(output),
897
871
  });
898
872
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
899
- if (data.FailedDisassociatedResources != null) {
900
- contents.FailedDisassociatedResources = de_DisassociateResourcesResponseList(data.FailedDisassociatedResources, context);
901
- }
902
- if (data.SuccessfullyDisassociatedResources != null) {
903
- contents.SuccessfullyDisassociatedResources = de_DisassociateResourcesResponseList(data.SuccessfullyDisassociatedResources, context);
904
- }
873
+ const doc = take(data, {
874
+ FailedDisassociatedResources: _json,
875
+ SuccessfullyDisassociatedResources: _json,
876
+ });
877
+ Object.assign(contents, doc);
905
878
  return contents;
906
879
  };
907
880
  const de_BatchDisassociateResourcesFromCustomLineItemCommandError = async (output, context) => {
@@ -931,10 +904,9 @@ const de_BatchDisassociateResourcesFromCustomLineItemCommandError = async (outpu
931
904
  throw await de_ValidationExceptionRes(parsedOutput, context);
932
905
  default:
933
906
  const parsedBody = parsedOutput.body;
934
- throwDefaultError({
907
+ return throwDefaultError({
935
908
  output,
936
909
  parsedBody,
937
- exceptionCtor: __BaseException,
938
910
  errorCode,
939
911
  });
940
912
  }
@@ -947,9 +919,10 @@ export const de_CreateBillingGroupCommand = async (output, context) => {
947
919
  $metadata: deserializeMetadata(output),
948
920
  });
949
921
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
950
- if (data.Arn != null) {
951
- contents.Arn = __expectString(data.Arn);
952
- }
922
+ const doc = take(data, {
923
+ Arn: __expectString,
924
+ });
925
+ Object.assign(contents, doc);
953
926
  return contents;
954
927
  };
955
928
  const de_CreateBillingGroupCommandError = async (output, context) => {
@@ -979,10 +952,9 @@ const de_CreateBillingGroupCommandError = async (output, context) => {
979
952
  throw await de_ValidationExceptionRes(parsedOutput, context);
980
953
  default:
981
954
  const parsedBody = parsedOutput.body;
982
- throwDefaultError({
955
+ return throwDefaultError({
983
956
  output,
984
957
  parsedBody,
985
- exceptionCtor: __BaseException,
986
958
  errorCode,
987
959
  });
988
960
  }
@@ -995,9 +967,10 @@ export const de_CreateCustomLineItemCommand = async (output, context) => {
995
967
  $metadata: deserializeMetadata(output),
996
968
  });
997
969
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
998
- if (data.Arn != null) {
999
- contents.Arn = __expectString(data.Arn);
1000
- }
970
+ const doc = take(data, {
971
+ Arn: __expectString,
972
+ });
973
+ Object.assign(contents, doc);
1001
974
  return contents;
1002
975
  };
1003
976
  const de_CreateCustomLineItemCommandError = async (output, context) => {
@@ -1027,10 +1000,9 @@ const de_CreateCustomLineItemCommandError = async (output, context) => {
1027
1000
  throw await de_ValidationExceptionRes(parsedOutput, context);
1028
1001
  default:
1029
1002
  const parsedBody = parsedOutput.body;
1030
- throwDefaultError({
1003
+ return throwDefaultError({
1031
1004
  output,
1032
1005
  parsedBody,
1033
- exceptionCtor: __BaseException,
1034
1006
  errorCode,
1035
1007
  });
1036
1008
  }
@@ -1043,9 +1015,10 @@ export const de_CreatePricingPlanCommand = async (output, context) => {
1043
1015
  $metadata: deserializeMetadata(output),
1044
1016
  });
1045
1017
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1046
- if (data.Arn != null) {
1047
- contents.Arn = __expectString(data.Arn);
1048
- }
1018
+ const doc = take(data, {
1019
+ Arn: __expectString,
1020
+ });
1021
+ Object.assign(contents, doc);
1049
1022
  return contents;
1050
1023
  };
1051
1024
  const de_CreatePricingPlanCommandError = async (output, context) => {
@@ -1078,10 +1051,9 @@ const de_CreatePricingPlanCommandError = async (output, context) => {
1078
1051
  throw await de_ValidationExceptionRes(parsedOutput, context);
1079
1052
  default:
1080
1053
  const parsedBody = parsedOutput.body;
1081
- throwDefaultError({
1054
+ return throwDefaultError({
1082
1055
  output,
1083
1056
  parsedBody,
1084
- exceptionCtor: __BaseException,
1085
1057
  errorCode,
1086
1058
  });
1087
1059
  }
@@ -1094,9 +1066,10 @@ export const de_CreatePricingRuleCommand = async (output, context) => {
1094
1066
  $metadata: deserializeMetadata(output),
1095
1067
  });
1096
1068
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1097
- if (data.Arn != null) {
1098
- contents.Arn = __expectString(data.Arn);
1099
- }
1069
+ const doc = take(data, {
1070
+ Arn: __expectString,
1071
+ });
1072
+ Object.assign(contents, doc);
1100
1073
  return contents;
1101
1074
  };
1102
1075
  const de_CreatePricingRuleCommandError = async (output, context) => {
@@ -1126,10 +1099,9 @@ const de_CreatePricingRuleCommandError = async (output, context) => {
1126
1099
  throw await de_ValidationExceptionRes(parsedOutput, context);
1127
1100
  default:
1128
1101
  const parsedBody = parsedOutput.body;
1129
- throwDefaultError({
1102
+ return throwDefaultError({
1130
1103
  output,
1131
1104
  parsedBody,
1132
- exceptionCtor: __BaseException,
1133
1105
  errorCode,
1134
1106
  });
1135
1107
  }
@@ -1142,9 +1114,10 @@ export const de_DeleteBillingGroupCommand = async (output, context) => {
1142
1114
  $metadata: deserializeMetadata(output),
1143
1115
  });
1144
1116
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1145
- if (data.Arn != null) {
1146
- contents.Arn = __expectString(data.Arn);
1147
- }
1117
+ const doc = take(data, {
1118
+ Arn: __expectString,
1119
+ });
1120
+ Object.assign(contents, doc);
1148
1121
  return contents;
1149
1122
  };
1150
1123
  const de_DeleteBillingGroupCommandError = async (output, context) => {
@@ -1168,10 +1141,9 @@ const de_DeleteBillingGroupCommandError = async (output, context) => {
1168
1141
  throw await de_ValidationExceptionRes(parsedOutput, context);
1169
1142
  default:
1170
1143
  const parsedBody = parsedOutput.body;
1171
- throwDefaultError({
1144
+ return throwDefaultError({
1172
1145
  output,
1173
1146
  parsedBody,
1174
- exceptionCtor: __BaseException,
1175
1147
  errorCode,
1176
1148
  });
1177
1149
  }
@@ -1184,9 +1156,10 @@ export const de_DeleteCustomLineItemCommand = async (output, context) => {
1184
1156
  $metadata: deserializeMetadata(output),
1185
1157
  });
1186
1158
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1187
- if (data.Arn != null) {
1188
- contents.Arn = __expectString(data.Arn);
1189
- }
1159
+ const doc = take(data, {
1160
+ Arn: __expectString,
1161
+ });
1162
+ Object.assign(contents, doc);
1190
1163
  return contents;
1191
1164
  };
1192
1165
  const de_DeleteCustomLineItemCommandError = async (output, context) => {
@@ -1213,10 +1186,9 @@ const de_DeleteCustomLineItemCommandError = async (output, context) => {
1213
1186
  throw await de_ValidationExceptionRes(parsedOutput, context);
1214
1187
  default:
1215
1188
  const parsedBody = parsedOutput.body;
1216
- throwDefaultError({
1189
+ return throwDefaultError({
1217
1190
  output,
1218
1191
  parsedBody,
1219
- exceptionCtor: __BaseException,
1220
1192
  errorCode,
1221
1193
  });
1222
1194
  }
@@ -1229,9 +1201,10 @@ export const de_DeletePricingPlanCommand = async (output, context) => {
1229
1201
  $metadata: deserializeMetadata(output),
1230
1202
  });
1231
1203
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1232
- if (data.Arn != null) {
1233
- contents.Arn = __expectString(data.Arn);
1234
- }
1204
+ const doc = take(data, {
1205
+ Arn: __expectString,
1206
+ });
1207
+ Object.assign(contents, doc);
1235
1208
  return contents;
1236
1209
  };
1237
1210
  const de_DeletePricingPlanCommandError = async (output, context) => {
@@ -1258,10 +1231,9 @@ const de_DeletePricingPlanCommandError = async (output, context) => {
1258
1231
  throw await de_ValidationExceptionRes(parsedOutput, context);
1259
1232
  default:
1260
1233
  const parsedBody = parsedOutput.body;
1261
- throwDefaultError({
1234
+ return throwDefaultError({
1262
1235
  output,
1263
1236
  parsedBody,
1264
- exceptionCtor: __BaseException,
1265
1237
  errorCode,
1266
1238
  });
1267
1239
  }
@@ -1274,9 +1246,10 @@ export const de_DeletePricingRuleCommand = async (output, context) => {
1274
1246
  $metadata: deserializeMetadata(output),
1275
1247
  });
1276
1248
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1277
- if (data.Arn != null) {
1278
- contents.Arn = __expectString(data.Arn);
1279
- }
1249
+ const doc = take(data, {
1250
+ Arn: __expectString,
1251
+ });
1252
+ Object.assign(contents, doc);
1280
1253
  return contents;
1281
1254
  };
1282
1255
  const de_DeletePricingRuleCommandError = async (output, context) => {
@@ -1303,10 +1276,9 @@ const de_DeletePricingRuleCommandError = async (output, context) => {
1303
1276
  throw await de_ValidationExceptionRes(parsedOutput, context);
1304
1277
  default:
1305
1278
  const parsedBody = parsedOutput.body;
1306
- throwDefaultError({
1279
+ return throwDefaultError({
1307
1280
  output,
1308
1281
  parsedBody,
1309
- exceptionCtor: __BaseException,
1310
1282
  errorCode,
1311
1283
  });
1312
1284
  }
@@ -1319,9 +1291,10 @@ export const de_DisassociateAccountsCommand = async (output, context) => {
1319
1291
  $metadata: deserializeMetadata(output),
1320
1292
  });
1321
1293
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1322
- if (data.Arn != null) {
1323
- contents.Arn = __expectString(data.Arn);
1324
- }
1294
+ const doc = take(data, {
1295
+ Arn: __expectString,
1296
+ });
1297
+ Object.assign(contents, doc);
1325
1298
  return contents;
1326
1299
  };
1327
1300
  const de_DisassociateAccountsCommandError = async (output, context) => {
@@ -1351,10 +1324,9 @@ const de_DisassociateAccountsCommandError = async (output, context) => {
1351
1324
  throw await de_ValidationExceptionRes(parsedOutput, context);
1352
1325
  default:
1353
1326
  const parsedBody = parsedOutput.body;
1354
- throwDefaultError({
1327
+ return throwDefaultError({
1355
1328
  output,
1356
1329
  parsedBody,
1357
- exceptionCtor: __BaseException,
1358
1330
  errorCode,
1359
1331
  });
1360
1332
  }
@@ -1367,9 +1339,10 @@ export const de_DisassociatePricingRulesCommand = async (output, context) => {
1367
1339
  $metadata: deserializeMetadata(output),
1368
1340
  });
1369
1341
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1370
- if (data.Arn != null) {
1371
- contents.Arn = __expectString(data.Arn);
1372
- }
1342
+ const doc = take(data, {
1343
+ Arn: __expectString,
1344
+ });
1345
+ Object.assign(contents, doc);
1373
1346
  return contents;
1374
1347
  };
1375
1348
  const de_DisassociatePricingRulesCommandError = async (output, context) => {
@@ -1399,10 +1372,9 @@ const de_DisassociatePricingRulesCommandError = async (output, context) => {
1399
1372
  throw await de_ValidationExceptionRes(parsedOutput, context);
1400
1373
  default:
1401
1374
  const parsedBody = parsedOutput.body;
1402
- throwDefaultError({
1375
+ return throwDefaultError({
1403
1376
  output,
1404
1377
  parsedBody,
1405
- exceptionCtor: __BaseException,
1406
1378
  errorCode,
1407
1379
  });
1408
1380
  }
@@ -1415,12 +1387,11 @@ export const de_ListAccountAssociationsCommand = async (output, context) => {
1415
1387
  $metadata: deserializeMetadata(output),
1416
1388
  });
1417
1389
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1418
- if (data.LinkedAccounts != null) {
1419
- contents.LinkedAccounts = de_AccountAssociationsList(data.LinkedAccounts, context);
1420
- }
1421
- if (data.NextToken != null) {
1422
- contents.NextToken = __expectString(data.NextToken);
1423
- }
1390
+ const doc = take(data, {
1391
+ LinkedAccounts: _json,
1392
+ NextToken: __expectString,
1393
+ });
1394
+ Object.assign(contents, doc);
1424
1395
  return contents;
1425
1396
  };
1426
1397
  const de_ListAccountAssociationsCommandError = async (output, context) => {
@@ -1447,10 +1418,9 @@ const de_ListAccountAssociationsCommandError = async (output, context) => {
1447
1418
  throw await de_ValidationExceptionRes(parsedOutput, context);
1448
1419
  default:
1449
1420
  const parsedBody = parsedOutput.body;
1450
- throwDefaultError({
1421
+ return throwDefaultError({
1451
1422
  output,
1452
1423
  parsedBody,
1453
- exceptionCtor: __BaseException,
1454
1424
  errorCode,
1455
1425
  });
1456
1426
  }
@@ -1463,12 +1433,11 @@ export const de_ListBillingGroupCostReportsCommand = async (output, context) =>
1463
1433
  $metadata: deserializeMetadata(output),
1464
1434
  });
1465
1435
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1466
- if (data.BillingGroupCostReports != null) {
1467
- contents.BillingGroupCostReports = de_BillingGroupCostReportList(data.BillingGroupCostReports, context);
1468
- }
1469
- if (data.NextToken != null) {
1470
- contents.NextToken = __expectString(data.NextToken);
1471
- }
1436
+ const doc = take(data, {
1437
+ BillingGroupCostReports: _json,
1438
+ NextToken: __expectString,
1439
+ });
1440
+ Object.assign(contents, doc);
1472
1441
  return contents;
1473
1442
  };
1474
1443
  const de_ListBillingGroupCostReportsCommandError = async (output, context) => {
@@ -1495,10 +1464,9 @@ const de_ListBillingGroupCostReportsCommandError = async (output, context) => {
1495
1464
  throw await de_ValidationExceptionRes(parsedOutput, context);
1496
1465
  default:
1497
1466
  const parsedBody = parsedOutput.body;
1498
- throwDefaultError({
1467
+ return throwDefaultError({
1499
1468
  output,
1500
1469
  parsedBody,
1501
- exceptionCtor: __BaseException,
1502
1470
  errorCode,
1503
1471
  });
1504
1472
  }
@@ -1511,12 +1479,11 @@ export const de_ListBillingGroupsCommand = async (output, context) => {
1511
1479
  $metadata: deserializeMetadata(output),
1512
1480
  });
1513
1481
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1514
- if (data.BillingGroups != null) {
1515
- contents.BillingGroups = de_BillingGroupList(data.BillingGroups, context);
1516
- }
1517
- if (data.NextToken != null) {
1518
- contents.NextToken = __expectString(data.NextToken);
1519
- }
1482
+ const doc = take(data, {
1483
+ BillingGroups: _json,
1484
+ NextToken: __expectString,
1485
+ });
1486
+ Object.assign(contents, doc);
1520
1487
  return contents;
1521
1488
  };
1522
1489
  const de_ListBillingGroupsCommandError = async (output, context) => {
@@ -1543,10 +1510,9 @@ const de_ListBillingGroupsCommandError = async (output, context) => {
1543
1510
  throw await de_ValidationExceptionRes(parsedOutput, context);
1544
1511
  default:
1545
1512
  const parsedBody = parsedOutput.body;
1546
- throwDefaultError({
1513
+ return throwDefaultError({
1547
1514
  output,
1548
1515
  parsedBody,
1549
- exceptionCtor: __BaseException,
1550
1516
  errorCode,
1551
1517
  });
1552
1518
  }
@@ -1559,12 +1525,11 @@ export const de_ListCustomLineItemsCommand = async (output, context) => {
1559
1525
  $metadata: deserializeMetadata(output),
1560
1526
  });
1561
1527
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1562
- if (data.CustomLineItems != null) {
1563
- contents.CustomLineItems = de_CustomLineItemList(data.CustomLineItems, context);
1564
- }
1565
- if (data.NextToken != null) {
1566
- contents.NextToken = __expectString(data.NextToken);
1567
- }
1528
+ const doc = take(data, {
1529
+ CustomLineItems: (_) => de_CustomLineItemList(_, context),
1530
+ NextToken: __expectString,
1531
+ });
1532
+ Object.assign(contents, doc);
1568
1533
  return contents;
1569
1534
  };
1570
1535
  const de_ListCustomLineItemsCommandError = async (output, context) => {
@@ -1591,10 +1556,9 @@ const de_ListCustomLineItemsCommandError = async (output, context) => {
1591
1556
  throw await de_ValidationExceptionRes(parsedOutput, context);
1592
1557
  default:
1593
1558
  const parsedBody = parsedOutput.body;
1594
- throwDefaultError({
1559
+ return throwDefaultError({
1595
1560
  output,
1596
1561
  parsedBody,
1597
- exceptionCtor: __BaseException,
1598
1562
  errorCode,
1599
1563
  });
1600
1564
  }
@@ -1607,12 +1571,11 @@ export const de_ListCustomLineItemVersionsCommand = async (output, context) => {
1607
1571
  $metadata: deserializeMetadata(output),
1608
1572
  });
1609
1573
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1610
- if (data.CustomLineItemVersions != null) {
1611
- contents.CustomLineItemVersions = de_CustomLineItemVersionList(data.CustomLineItemVersions, context);
1612
- }
1613
- if (data.NextToken != null) {
1614
- contents.NextToken = __expectString(data.NextToken);
1615
- }
1574
+ const doc = take(data, {
1575
+ CustomLineItemVersions: (_) => de_CustomLineItemVersionList(_, context),
1576
+ NextToken: __expectString,
1577
+ });
1578
+ Object.assign(contents, doc);
1616
1579
  return contents;
1617
1580
  };
1618
1581
  const de_ListCustomLineItemVersionsCommandError = async (output, context) => {
@@ -1636,10 +1599,9 @@ const de_ListCustomLineItemVersionsCommandError = async (output, context) => {
1636
1599
  throw await de_ValidationExceptionRes(parsedOutput, context);
1637
1600
  default:
1638
1601
  const parsedBody = parsedOutput.body;
1639
- throwDefaultError({
1602
+ return throwDefaultError({
1640
1603
  output,
1641
1604
  parsedBody,
1642
- exceptionCtor: __BaseException,
1643
1605
  errorCode,
1644
1606
  });
1645
1607
  }
@@ -1652,15 +1614,12 @@ export const de_ListPricingPlansCommand = async (output, context) => {
1652
1614
  $metadata: deserializeMetadata(output),
1653
1615
  });
1654
1616
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1655
- if (data.BillingPeriod != null) {
1656
- contents.BillingPeriod = __expectString(data.BillingPeriod);
1657
- }
1658
- if (data.NextToken != null) {
1659
- contents.NextToken = __expectString(data.NextToken);
1660
- }
1661
- if (data.PricingPlans != null) {
1662
- contents.PricingPlans = de_PricingPlanList(data.PricingPlans, context);
1663
- }
1617
+ const doc = take(data, {
1618
+ BillingPeriod: __expectString,
1619
+ NextToken: __expectString,
1620
+ PricingPlans: _json,
1621
+ });
1622
+ Object.assign(contents, doc);
1664
1623
  return contents;
1665
1624
  };
1666
1625
  const de_ListPricingPlansCommandError = async (output, context) => {
@@ -1684,10 +1643,9 @@ const de_ListPricingPlansCommandError = async (output, context) => {
1684
1643
  throw await de_ValidationExceptionRes(parsedOutput, context);
1685
1644
  default:
1686
1645
  const parsedBody = parsedOutput.body;
1687
- throwDefaultError({
1646
+ return throwDefaultError({
1688
1647
  output,
1689
1648
  parsedBody,
1690
- exceptionCtor: __BaseException,
1691
1649
  errorCode,
1692
1650
  });
1693
1651
  }
@@ -1700,18 +1658,13 @@ export const de_ListPricingPlansAssociatedWithPricingRuleCommand = async (output
1700
1658
  $metadata: deserializeMetadata(output),
1701
1659
  });
1702
1660
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1703
- if (data.BillingPeriod != null) {
1704
- contents.BillingPeriod = __expectString(data.BillingPeriod);
1705
- }
1706
- if (data.NextToken != null) {
1707
- contents.NextToken = __expectString(data.NextToken);
1708
- }
1709
- if (data.PricingPlanArns != null) {
1710
- contents.PricingPlanArns = de_PricingPlanArns(data.PricingPlanArns, context);
1711
- }
1712
- if (data.PricingRuleArn != null) {
1713
- contents.PricingRuleArn = __expectString(data.PricingRuleArn);
1714
- }
1661
+ const doc = take(data, {
1662
+ BillingPeriod: __expectString,
1663
+ NextToken: __expectString,
1664
+ PricingPlanArns: _json,
1665
+ PricingRuleArn: __expectString,
1666
+ });
1667
+ Object.assign(contents, doc);
1715
1668
  return contents;
1716
1669
  };
1717
1670
  const de_ListPricingPlansAssociatedWithPricingRuleCommandError = async (output, context) => {
@@ -1738,10 +1691,9 @@ const de_ListPricingPlansAssociatedWithPricingRuleCommandError = async (output,
1738
1691
  throw await de_ValidationExceptionRes(parsedOutput, context);
1739
1692
  default:
1740
1693
  const parsedBody = parsedOutput.body;
1741
- throwDefaultError({
1694
+ return throwDefaultError({
1742
1695
  output,
1743
1696
  parsedBody,
1744
- exceptionCtor: __BaseException,
1745
1697
  errorCode,
1746
1698
  });
1747
1699
  }
@@ -1754,15 +1706,12 @@ export const de_ListPricingRulesCommand = async (output, context) => {
1754
1706
  $metadata: deserializeMetadata(output),
1755
1707
  });
1756
1708
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1757
- if (data.BillingPeriod != null) {
1758
- contents.BillingPeriod = __expectString(data.BillingPeriod);
1759
- }
1760
- if (data.NextToken != null) {
1761
- contents.NextToken = __expectString(data.NextToken);
1762
- }
1763
- if (data.PricingRules != null) {
1764
- contents.PricingRules = de_PricingRuleList(data.PricingRules, context);
1765
- }
1709
+ const doc = take(data, {
1710
+ BillingPeriod: __expectString,
1711
+ NextToken: __expectString,
1712
+ PricingRules: (_) => de_PricingRuleList(_, context),
1713
+ });
1714
+ Object.assign(contents, doc);
1766
1715
  return contents;
1767
1716
  };
1768
1717
  const de_ListPricingRulesCommandError = async (output, context) => {
@@ -1786,10 +1735,9 @@ const de_ListPricingRulesCommandError = async (output, context) => {
1786
1735
  throw await de_ValidationExceptionRes(parsedOutput, context);
1787
1736
  default:
1788
1737
  const parsedBody = parsedOutput.body;
1789
- throwDefaultError({
1738
+ return throwDefaultError({
1790
1739
  output,
1791
1740
  parsedBody,
1792
- exceptionCtor: __BaseException,
1793
1741
  errorCode,
1794
1742
  });
1795
1743
  }
@@ -1802,18 +1750,13 @@ export const de_ListPricingRulesAssociatedToPricingPlanCommand = async (output,
1802
1750
  $metadata: deserializeMetadata(output),
1803
1751
  });
1804
1752
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1805
- if (data.BillingPeriod != null) {
1806
- contents.BillingPeriod = __expectString(data.BillingPeriod);
1807
- }
1808
- if (data.NextToken != null) {
1809
- contents.NextToken = __expectString(data.NextToken);
1810
- }
1811
- if (data.PricingPlanArn != null) {
1812
- contents.PricingPlanArn = __expectString(data.PricingPlanArn);
1813
- }
1814
- if (data.PricingRuleArns != null) {
1815
- contents.PricingRuleArns = de_PricingRuleArns(data.PricingRuleArns, context);
1816
- }
1753
+ const doc = take(data, {
1754
+ BillingPeriod: __expectString,
1755
+ NextToken: __expectString,
1756
+ PricingPlanArn: __expectString,
1757
+ PricingRuleArns: _json,
1758
+ });
1759
+ Object.assign(contents, doc);
1817
1760
  return contents;
1818
1761
  };
1819
1762
  const de_ListPricingRulesAssociatedToPricingPlanCommandError = async (output, context) => {
@@ -1840,10 +1783,9 @@ const de_ListPricingRulesAssociatedToPricingPlanCommandError = async (output, co
1840
1783
  throw await de_ValidationExceptionRes(parsedOutput, context);
1841
1784
  default:
1842
1785
  const parsedBody = parsedOutput.body;
1843
- throwDefaultError({
1786
+ return throwDefaultError({
1844
1787
  output,
1845
1788
  parsedBody,
1846
- exceptionCtor: __BaseException,
1847
1789
  errorCode,
1848
1790
  });
1849
1791
  }
@@ -1856,15 +1798,12 @@ export const de_ListResourcesAssociatedToCustomLineItemCommand = async (output,
1856
1798
  $metadata: deserializeMetadata(output),
1857
1799
  });
1858
1800
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1859
- if (data.Arn != null) {
1860
- contents.Arn = __expectString(data.Arn);
1861
- }
1862
- if (data.AssociatedResources != null) {
1863
- contents.AssociatedResources = de_ListResourcesAssociatedToCustomLineItemResponseList(data.AssociatedResources, context);
1864
- }
1865
- if (data.NextToken != null) {
1866
- contents.NextToken = __expectString(data.NextToken);
1867
- }
1801
+ const doc = take(data, {
1802
+ Arn: __expectString,
1803
+ AssociatedResources: _json,
1804
+ NextToken: __expectString,
1805
+ });
1806
+ Object.assign(contents, doc);
1868
1807
  return contents;
1869
1808
  };
1870
1809
  const de_ListResourcesAssociatedToCustomLineItemCommandError = async (output, context) => {
@@ -1891,10 +1830,9 @@ const de_ListResourcesAssociatedToCustomLineItemCommandError = async (output, co
1891
1830
  throw await de_ValidationExceptionRes(parsedOutput, context);
1892
1831
  default:
1893
1832
  const parsedBody = parsedOutput.body;
1894
- throwDefaultError({
1833
+ return throwDefaultError({
1895
1834
  output,
1896
1835
  parsedBody,
1897
- exceptionCtor: __BaseException,
1898
1836
  errorCode,
1899
1837
  });
1900
1838
  }
@@ -1907,9 +1845,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1907
1845
  $metadata: deserializeMetadata(output),
1908
1846
  });
1909
1847
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1910
- if (data.Tags != null) {
1911
- contents.Tags = de_TagMap(data.Tags, context);
1912
- }
1848
+ const doc = take(data, {
1849
+ Tags: _json,
1850
+ });
1851
+ Object.assign(contents, doc);
1913
1852
  return contents;
1914
1853
  };
1915
1854
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -1936,10 +1875,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
1936
1875
  throw await de_ValidationExceptionRes(parsedOutput, context);
1937
1876
  default:
1938
1877
  const parsedBody = parsedOutput.body;
1939
- throwDefaultError({
1878
+ return throwDefaultError({
1940
1879
  output,
1941
1880
  parsedBody,
1942
- exceptionCtor: __BaseException,
1943
1881
  errorCode,
1944
1882
  });
1945
1883
  }
@@ -1978,10 +1916,9 @@ const de_TagResourceCommandError = async (output, context) => {
1978
1916
  throw await de_ValidationExceptionRes(parsedOutput, context);
1979
1917
  default:
1980
1918
  const parsedBody = parsedOutput.body;
1981
- throwDefaultError({
1919
+ return throwDefaultError({
1982
1920
  output,
1983
1921
  parsedBody,
1984
- exceptionCtor: __BaseException,
1985
1922
  errorCode,
1986
1923
  });
1987
1924
  }
@@ -2020,10 +1957,9 @@ const de_UntagResourceCommandError = async (output, context) => {
2020
1957
  throw await de_ValidationExceptionRes(parsedOutput, context);
2021
1958
  default:
2022
1959
  const parsedBody = parsedOutput.body;
2023
- throwDefaultError({
1960
+ return throwDefaultError({
2024
1961
  output,
2025
1962
  parsedBody,
2026
- exceptionCtor: __BaseException,
2027
1963
  errorCode,
2028
1964
  });
2029
1965
  }
@@ -2036,33 +1972,18 @@ export const de_UpdateBillingGroupCommand = async (output, context) => {
2036
1972
  $metadata: deserializeMetadata(output),
2037
1973
  });
2038
1974
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2039
- if (data.Arn != null) {
2040
- contents.Arn = __expectString(data.Arn);
2041
- }
2042
- if (data.Description != null) {
2043
- contents.Description = __expectString(data.Description);
2044
- }
2045
- if (data.LastModifiedTime != null) {
2046
- contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2047
- }
2048
- if (data.Name != null) {
2049
- contents.Name = __expectString(data.Name);
2050
- }
2051
- if (data.PricingPlanArn != null) {
2052
- contents.PricingPlanArn = __expectString(data.PricingPlanArn);
2053
- }
2054
- if (data.PrimaryAccountId != null) {
2055
- contents.PrimaryAccountId = __expectString(data.PrimaryAccountId);
2056
- }
2057
- if (data.Size != null) {
2058
- contents.Size = __expectLong(data.Size);
2059
- }
2060
- if (data.Status != null) {
2061
- contents.Status = __expectString(data.Status);
2062
- }
2063
- if (data.StatusReason != null) {
2064
- contents.StatusReason = __expectString(data.StatusReason);
2065
- }
1975
+ const doc = take(data, {
1976
+ Arn: __expectString,
1977
+ Description: __expectString,
1978
+ LastModifiedTime: __expectLong,
1979
+ Name: __expectString,
1980
+ PricingPlanArn: __expectString,
1981
+ PrimaryAccountId: __expectString,
1982
+ Size: __expectLong,
1983
+ Status: __expectString,
1984
+ StatusReason: __expectString,
1985
+ });
1986
+ Object.assign(contents, doc);
2066
1987
  return contents;
2067
1988
  };
2068
1989
  const de_UpdateBillingGroupCommandError = async (output, context) => {
@@ -2092,10 +2013,9 @@ const de_UpdateBillingGroupCommandError = async (output, context) => {
2092
2013
  throw await de_ValidationExceptionRes(parsedOutput, context);
2093
2014
  default:
2094
2015
  const parsedBody = parsedOutput.body;
2095
- throwDefaultError({
2016
+ return throwDefaultError({
2096
2017
  output,
2097
2018
  parsedBody,
2098
- exceptionCtor: __BaseException,
2099
2019
  errorCode,
2100
2020
  });
2101
2021
  }
@@ -2108,27 +2028,16 @@ export const de_UpdateCustomLineItemCommand = async (output, context) => {
2108
2028
  $metadata: deserializeMetadata(output),
2109
2029
  });
2110
2030
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2111
- if (data.Arn != null) {
2112
- contents.Arn = __expectString(data.Arn);
2113
- }
2114
- if (data.AssociationSize != null) {
2115
- contents.AssociationSize = __expectLong(data.AssociationSize);
2116
- }
2117
- if (data.BillingGroupArn != null) {
2118
- contents.BillingGroupArn = __expectString(data.BillingGroupArn);
2119
- }
2120
- if (data.ChargeDetails != null) {
2121
- contents.ChargeDetails = de_ListCustomLineItemChargeDetails(data.ChargeDetails, context);
2122
- }
2123
- if (data.Description != null) {
2124
- contents.Description = __expectString(data.Description);
2125
- }
2126
- if (data.LastModifiedTime != null) {
2127
- contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2128
- }
2129
- if (data.Name != null) {
2130
- contents.Name = __expectString(data.Name);
2131
- }
2031
+ const doc = take(data, {
2032
+ Arn: __expectString,
2033
+ AssociationSize: __expectLong,
2034
+ BillingGroupArn: __expectString,
2035
+ ChargeDetails: (_) => de_ListCustomLineItemChargeDetails(_, context),
2036
+ Description: __expectString,
2037
+ LastModifiedTime: __expectLong,
2038
+ Name: __expectString,
2039
+ });
2040
+ Object.assign(contents, doc);
2132
2041
  return contents;
2133
2042
  };
2134
2043
  const de_UpdateCustomLineItemCommandError = async (output, context) => {
@@ -2155,10 +2064,9 @@ const de_UpdateCustomLineItemCommandError = async (output, context) => {
2155
2064
  throw await de_ValidationExceptionRes(parsedOutput, context);
2156
2065
  default:
2157
2066
  const parsedBody = parsedOutput.body;
2158
- throwDefaultError({
2067
+ return throwDefaultError({
2159
2068
  output,
2160
2069
  parsedBody,
2161
- exceptionCtor: __BaseException,
2162
2070
  errorCode,
2163
2071
  });
2164
2072
  }
@@ -2171,21 +2079,14 @@ export const de_UpdatePricingPlanCommand = async (output, context) => {
2171
2079
  $metadata: deserializeMetadata(output),
2172
2080
  });
2173
2081
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2174
- if (data.Arn != null) {
2175
- contents.Arn = __expectString(data.Arn);
2176
- }
2177
- if (data.Description != null) {
2178
- contents.Description = __expectString(data.Description);
2179
- }
2180
- if (data.LastModifiedTime != null) {
2181
- contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2182
- }
2183
- if (data.Name != null) {
2184
- contents.Name = __expectString(data.Name);
2185
- }
2186
- if (data.Size != null) {
2187
- contents.Size = __expectLong(data.Size);
2188
- }
2082
+ const doc = take(data, {
2083
+ Arn: __expectString,
2084
+ Description: __expectString,
2085
+ LastModifiedTime: __expectLong,
2086
+ Name: __expectString,
2087
+ Size: __expectLong,
2088
+ });
2089
+ Object.assign(contents, doc);
2189
2090
  return contents;
2190
2091
  };
2191
2092
  const de_UpdatePricingPlanCommandError = async (output, context) => {
@@ -2215,10 +2116,9 @@ const de_UpdatePricingPlanCommandError = async (output, context) => {
2215
2116
  throw await de_ValidationExceptionRes(parsedOutput, context);
2216
2117
  default:
2217
2118
  const parsedBody = parsedOutput.body;
2218
- throwDefaultError({
2119
+ return throwDefaultError({
2219
2120
  output,
2220
2121
  parsedBody,
2221
- exceptionCtor: __BaseException,
2222
2122
  errorCode,
2223
2123
  });
2224
2124
  }
@@ -2231,45 +2131,22 @@ export const de_UpdatePricingRuleCommand = async (output, context) => {
2231
2131
  $metadata: deserializeMetadata(output),
2232
2132
  });
2233
2133
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2234
- if (data.Arn != null) {
2235
- contents.Arn = __expectString(data.Arn);
2236
- }
2237
- if (data.AssociatedPricingPlanCount != null) {
2238
- contents.AssociatedPricingPlanCount = __expectLong(data.AssociatedPricingPlanCount);
2239
- }
2240
- if (data.BillingEntity != null) {
2241
- contents.BillingEntity = __expectString(data.BillingEntity);
2242
- }
2243
- if (data.Description != null) {
2244
- contents.Description = __expectString(data.Description);
2245
- }
2246
- if (data.LastModifiedTime != null) {
2247
- contents.LastModifiedTime = __expectLong(data.LastModifiedTime);
2248
- }
2249
- if (data.ModifierPercentage != null) {
2250
- contents.ModifierPercentage = __limitedParseDouble(data.ModifierPercentage);
2251
- }
2252
- if (data.Name != null) {
2253
- contents.Name = __expectString(data.Name);
2254
- }
2255
- if (data.Operation != null) {
2256
- contents.Operation = __expectString(data.Operation);
2257
- }
2258
- if (data.Scope != null) {
2259
- contents.Scope = __expectString(data.Scope);
2260
- }
2261
- if (data.Service != null) {
2262
- contents.Service = __expectString(data.Service);
2263
- }
2264
- if (data.Tiering != null) {
2265
- contents.Tiering = de_UpdateTieringInput(data.Tiering, context);
2266
- }
2267
- if (data.Type != null) {
2268
- contents.Type = __expectString(data.Type);
2269
- }
2270
- if (data.UsageType != null) {
2271
- contents.UsageType = __expectString(data.UsageType);
2272
- }
2134
+ const doc = take(data, {
2135
+ Arn: __expectString,
2136
+ AssociatedPricingPlanCount: __expectLong,
2137
+ BillingEntity: __expectString,
2138
+ Description: __expectString,
2139
+ LastModifiedTime: __expectLong,
2140
+ ModifierPercentage: __limitedParseDouble,
2141
+ Name: __expectString,
2142
+ Operation: __expectString,
2143
+ Scope: __expectString,
2144
+ Service: __expectString,
2145
+ Tiering: _json,
2146
+ Type: __expectString,
2147
+ UsageType: __expectString,
2148
+ });
2149
+ Object.assign(contents, doc);
2273
2150
  return contents;
2274
2151
  };
2275
2152
  const de_UpdatePricingRuleCommandError = async (output, context) => {
@@ -2299,21 +2176,21 @@ const de_UpdatePricingRuleCommandError = async (output, context) => {
2299
2176
  throw await de_ValidationExceptionRes(parsedOutput, context);
2300
2177
  default:
2301
2178
  const parsedBody = parsedOutput.body;
2302
- throwDefaultError({
2179
+ return throwDefaultError({
2303
2180
  output,
2304
2181
  parsedBody,
2305
- exceptionCtor: __BaseException,
2306
2182
  errorCode,
2307
2183
  });
2308
2184
  }
2309
2185
  };
2310
- const map = __map;
2186
+ const throwDefaultError = withBaseException(__BaseException);
2311
2187
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
2312
2188
  const contents = map({});
2313
2189
  const data = parsedOutput.body;
2314
- if (data.Message != null) {
2315
- contents.Message = __expectString(data.Message);
2316
- }
2190
+ const doc = take(data, {
2191
+ Message: __expectString,
2192
+ });
2193
+ Object.assign(contents, doc);
2317
2194
  const exception = new AccessDeniedException({
2318
2195
  $metadata: deserializeMetadata(parsedOutput),
2319
2196
  ...contents,
@@ -2323,18 +2200,13 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
2323
2200
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
2324
2201
  const contents = map({});
2325
2202
  const data = parsedOutput.body;
2326
- if (data.Message != null) {
2327
- contents.Message = __expectString(data.Message);
2328
- }
2329
- if (data.Reason != null) {
2330
- contents.Reason = __expectString(data.Reason);
2331
- }
2332
- if (data.ResourceId != null) {
2333
- contents.ResourceId = __expectString(data.ResourceId);
2334
- }
2335
- if (data.ResourceType != null) {
2336
- contents.ResourceType = __expectString(data.ResourceType);
2337
- }
2203
+ const doc = take(data, {
2204
+ Message: __expectString,
2205
+ Reason: __expectString,
2206
+ ResourceId: __expectString,
2207
+ ResourceType: __expectString,
2208
+ });
2209
+ Object.assign(contents, doc);
2338
2210
  const exception = new ConflictException({
2339
2211
  $metadata: deserializeMetadata(parsedOutput),
2340
2212
  ...contents,
@@ -2349,9 +2221,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
2349
2221
  ],
2350
2222
  });
2351
2223
  const data = parsedOutput.body;
2352
- if (data.Message != null) {
2353
- contents.Message = __expectString(data.Message);
2354
- }
2224
+ const doc = take(data, {
2225
+ Message: __expectString,
2226
+ });
2227
+ Object.assign(contents, doc);
2355
2228
  const exception = new InternalServerException({
2356
2229
  $metadata: deserializeMetadata(parsedOutput),
2357
2230
  ...contents,
@@ -2361,15 +2234,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
2361
2234
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
2362
2235
  const contents = map({});
2363
2236
  const data = parsedOutput.body;
2364
- if (data.Message != null) {
2365
- contents.Message = __expectString(data.Message);
2366
- }
2367
- if (data.ResourceId != null) {
2368
- contents.ResourceId = __expectString(data.ResourceId);
2369
- }
2370
- if (data.ResourceType != null) {
2371
- contents.ResourceType = __expectString(data.ResourceType);
2372
- }
2237
+ const doc = take(data, {
2238
+ Message: __expectString,
2239
+ ResourceId: __expectString,
2240
+ ResourceType: __expectString,
2241
+ });
2242
+ Object.assign(contents, doc);
2373
2243
  const exception = new ResourceNotFoundException({
2374
2244
  $metadata: deserializeMetadata(parsedOutput),
2375
2245
  ...contents,
@@ -2379,21 +2249,14 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
2379
2249
  const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
2380
2250
  const contents = map({});
2381
2251
  const data = parsedOutput.body;
2382
- if (data.LimitCode != null) {
2383
- contents.LimitCode = __expectString(data.LimitCode);
2384
- }
2385
- if (data.Message != null) {
2386
- contents.Message = __expectString(data.Message);
2387
- }
2388
- if (data.ResourceId != null) {
2389
- contents.ResourceId = __expectString(data.ResourceId);
2390
- }
2391
- if (data.ResourceType != null) {
2392
- contents.ResourceType = __expectString(data.ResourceType);
2393
- }
2394
- if (data.ServiceCode != null) {
2395
- contents.ServiceCode = __expectString(data.ServiceCode);
2396
- }
2252
+ const doc = take(data, {
2253
+ LimitCode: __expectString,
2254
+ Message: __expectString,
2255
+ ResourceId: __expectString,
2256
+ ResourceType: __expectString,
2257
+ ServiceCode: __expectString,
2258
+ });
2259
+ Object.assign(contents, doc);
2397
2260
  const exception = new ServiceLimitExceededException({
2398
2261
  $metadata: deserializeMetadata(parsedOutput),
2399
2262
  ...contents,
@@ -2408,9 +2271,10 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2408
2271
  ],
2409
2272
  });
2410
2273
  const data = parsedOutput.body;
2411
- if (data.Message != null) {
2412
- contents.Message = __expectString(data.Message);
2413
- }
2274
+ const doc = take(data, {
2275
+ Message: __expectString,
2276
+ });
2277
+ Object.assign(contents, doc);
2414
2278
  const exception = new ThrottlingException({
2415
2279
  $metadata: deserializeMetadata(parsedOutput),
2416
2280
  ...contents,
@@ -2420,572 +2284,141 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
2420
2284
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
2421
2285
  const contents = map({});
2422
2286
  const data = parsedOutput.body;
2423
- if (data.Fields != null) {
2424
- contents.Fields = de_ValidationExceptionFieldList(data.Fields, context);
2425
- }
2426
- if (data.Message != null) {
2427
- contents.Message = __expectString(data.Message);
2428
- }
2429
- if (data.Reason != null) {
2430
- contents.Reason = __expectString(data.Reason);
2431
- }
2287
+ const doc = take(data, {
2288
+ Fields: _json,
2289
+ Message: __expectString,
2290
+ Reason: __expectString,
2291
+ });
2292
+ Object.assign(contents, doc);
2432
2293
  const exception = new ValidationException({
2433
2294
  $metadata: deserializeMetadata(parsedOutput),
2434
2295
  ...contents,
2435
2296
  });
2436
2297
  return __decorateServiceException(exception, parsedOutput.body);
2437
2298
  };
2438
- const se_AccountGrouping = (input, context) => {
2439
- return {
2440
- ...(input.LinkedAccountIds != null && { LinkedAccountIds: se_AccountIdList(input.LinkedAccountIds, context) }),
2441
- };
2442
- };
2443
- const se_AccountIdFilterList = (input, context) => {
2444
- return input
2445
- .filter((e) => e != null)
2446
- .map((entry) => {
2447
- return entry;
2448
- });
2449
- };
2450
- const se_AccountIdList = (input, context) => {
2451
- return input
2452
- .filter((e) => e != null)
2453
- .map((entry) => {
2454
- return entry;
2455
- });
2456
- };
2457
- const se_BillingGroupArnList = (input, context) => {
2458
- return input
2459
- .filter((e) => e != null)
2460
- .map((entry) => {
2461
- return entry;
2462
- });
2463
- };
2464
- const se_BillingGroupStatusList = (input, context) => {
2465
- return input
2466
- .filter((e) => e != null)
2467
- .map((entry) => {
2468
- return entry;
2469
- });
2470
- };
2471
- const se_ComputationPreference = (input, context) => {
2472
- return {
2473
- ...(input.PricingPlanArn != null && { PricingPlanArn: input.PricingPlanArn }),
2474
- };
2475
- };
2476
- const se_CreateFreeTierConfig = (input, context) => {
2477
- return {
2478
- ...(input.Activated != null && { Activated: input.Activated }),
2479
- };
2480
- };
2481
- const se_CreateTieringInput = (input, context) => {
2482
- return {
2483
- ...(input.FreeTier != null && { FreeTier: se_CreateFreeTierConfig(input.FreeTier, context) }),
2484
- };
2485
- };
2486
- const se_CustomLineItemArns = (input, context) => {
2487
- return input
2488
- .filter((e) => e != null)
2489
- .map((entry) => {
2490
- return entry;
2491
- });
2492
- };
2493
- const se_CustomLineItemAssociationsList = (input, context) => {
2494
- return input
2495
- .filter((e) => e != null)
2496
- .map((entry) => {
2497
- return entry;
2498
- });
2499
- };
2500
- const se_CustomLineItemBatchAssociationsList = (input, context) => {
2501
- return input
2502
- .filter((e) => e != null)
2503
- .map((entry) => {
2504
- return entry;
2505
- });
2506
- };
2507
- const se_CustomLineItemBatchDisassociationsList = (input, context) => {
2508
- return input
2509
- .filter((e) => e != null)
2510
- .map((entry) => {
2511
- return entry;
2512
- });
2513
- };
2514
- const se_CustomLineItemBillingPeriodRange = (input, context) => {
2515
- return {
2516
- ...(input.ExclusiveEndBillingPeriod != null && { ExclusiveEndBillingPeriod: input.ExclusiveEndBillingPeriod }),
2517
- ...(input.InclusiveStartBillingPeriod != null && {
2518
- InclusiveStartBillingPeriod: input.InclusiveStartBillingPeriod,
2519
- }),
2520
- };
2521
- };
2522
2299
  const se_CustomLineItemChargeDetails = (input, context) => {
2523
- return {
2524
- ...(input.Flat != null && { Flat: se_CustomLineItemFlatChargeDetails(input.Flat, context) }),
2525
- ...(input.Percentage != null && {
2526
- Percentage: se_CustomLineItemPercentageChargeDetails(input.Percentage, context),
2527
- }),
2528
- ...(input.Type != null && { Type: input.Type }),
2529
- };
2300
+ return take(input, {
2301
+ Flat: (_) => se_CustomLineItemFlatChargeDetails(_, context),
2302
+ Percentage: (_) => se_CustomLineItemPercentageChargeDetails(_, context),
2303
+ Type: [],
2304
+ });
2530
2305
  };
2531
2306
  const se_CustomLineItemFlatChargeDetails = (input, context) => {
2532
- return {
2533
- ...(input.ChargeValue != null && { ChargeValue: __serializeFloat(input.ChargeValue) }),
2534
- };
2535
- };
2536
- const se_CustomLineItemNameList = (input, context) => {
2537
- return input
2538
- .filter((e) => e != null)
2539
- .map((entry) => {
2540
- return entry;
2307
+ return take(input, {
2308
+ ChargeValue: __serializeFloat,
2541
2309
  });
2542
2310
  };
2543
2311
  const se_CustomLineItemPercentageChargeDetails = (input, context) => {
2544
- return {
2545
- ...(input.AssociatedValues != null && {
2546
- AssociatedValues: se_CustomLineItemAssociationsList(input.AssociatedValues, context),
2547
- }),
2548
- ...(input.PercentageValue != null && { PercentageValue: __serializeFloat(input.PercentageValue) }),
2549
- };
2550
- };
2551
- const se_ListAccountAssociationsFilter = (input, context) => {
2552
- return {
2553
- ...(input.AccountId != null && { AccountId: input.AccountId }),
2554
- ...(input.AccountIds != null && { AccountIds: se_AccountIdFilterList(input.AccountIds, context) }),
2555
- ...(input.Association != null && { Association: input.Association }),
2556
- };
2557
- };
2558
- const se_ListBillingGroupCostReportsFilter = (input, context) => {
2559
- return {
2560
- ...(input.BillingGroupArns != null && {
2561
- BillingGroupArns: se_BillingGroupArnList(input.BillingGroupArns, context),
2562
- }),
2563
- };
2564
- };
2565
- const se_ListBillingGroupsFilter = (input, context) => {
2566
- return {
2567
- ...(input.Arns != null && { Arns: se_BillingGroupArnList(input.Arns, context) }),
2568
- ...(input.PricingPlan != null && { PricingPlan: input.PricingPlan }),
2569
- ...(input.Statuses != null && { Statuses: se_BillingGroupStatusList(input.Statuses, context) }),
2570
- };
2571
- };
2572
- const se_ListCustomLineItemsFilter = (input, context) => {
2573
- return {
2574
- ...(input.Arns != null && { Arns: se_CustomLineItemArns(input.Arns, context) }),
2575
- ...(input.BillingGroups != null && { BillingGroups: se_BillingGroupArnList(input.BillingGroups, context) }),
2576
- ...(input.Names != null && { Names: se_CustomLineItemNameList(input.Names, context) }),
2577
- };
2578
- };
2579
- const se_ListCustomLineItemVersionsBillingPeriodRangeFilter = (input, context) => {
2580
- return {
2581
- ...(input.EndBillingPeriod != null && { EndBillingPeriod: input.EndBillingPeriod }),
2582
- ...(input.StartBillingPeriod != null && { StartBillingPeriod: input.StartBillingPeriod }),
2583
- };
2584
- };
2585
- const se_ListCustomLineItemVersionsFilter = (input, context) => {
2586
- return {
2587
- ...(input.BillingPeriodRange != null && {
2588
- BillingPeriodRange: se_ListCustomLineItemVersionsBillingPeriodRangeFilter(input.BillingPeriodRange, context),
2589
- }),
2590
- };
2591
- };
2592
- const se_ListPricingPlansFilter = (input, context) => {
2593
- return {
2594
- ...(input.Arns != null && { Arns: se_PricingPlanArns(input.Arns, context) }),
2595
- };
2596
- };
2597
- const se_ListPricingRulesFilter = (input, context) => {
2598
- return {
2599
- ...(input.Arns != null && { Arns: se_PricingRuleArns(input.Arns, context) }),
2600
- };
2601
- };
2602
- const se_ListResourcesAssociatedToCustomLineItemFilter = (input, context) => {
2603
- return {
2604
- ...(input.Relationship != null && { Relationship: input.Relationship }),
2605
- };
2606
- };
2607
- const se_PricingPlanArns = (input, context) => {
2608
- return input
2609
- .filter((e) => e != null)
2610
- .map((entry) => {
2611
- return entry;
2612
- });
2613
- };
2614
- const se_PricingRuleArns = (input, context) => {
2615
- return input
2616
- .filter((e) => e != null)
2617
- .map((entry) => {
2618
- return entry;
2619
- });
2620
- };
2621
- const se_PricingRuleArnsInput = (input, context) => {
2622
- return input
2623
- .filter((e) => e != null)
2624
- .map((entry) => {
2625
- return entry;
2626
- });
2627
- };
2628
- const se_PricingRuleArnsNonEmptyInput = (input, context) => {
2629
- return input
2630
- .filter((e) => e != null)
2631
- .map((entry) => {
2632
- return entry;
2312
+ return take(input, {
2313
+ AssociatedValues: _json,
2314
+ PercentageValue: __serializeFloat,
2633
2315
  });
2634
2316
  };
2635
- const se_TagMap = (input, context) => {
2636
- return Object.entries(input).reduce((acc, [key, value]) => {
2637
- if (value === null) {
2638
- return acc;
2639
- }
2640
- acc[key] = value;
2641
- return acc;
2642
- }, {});
2643
- };
2644
2317
  const se_UpdateCustomLineItemChargeDetails = (input, context) => {
2645
- return {
2646
- ...(input.Flat != null && { Flat: se_UpdateCustomLineItemFlatChargeDetails(input.Flat, context) }),
2647
- ...(input.Percentage != null && {
2648
- Percentage: se_UpdateCustomLineItemPercentageChargeDetails(input.Percentage, context),
2649
- }),
2650
- };
2651
- };
2652
- const se_UpdateCustomLineItemFlatChargeDetails = (input, context) => {
2653
- return {
2654
- ...(input.ChargeValue != null && { ChargeValue: __serializeFloat(input.ChargeValue) }),
2655
- };
2656
- };
2657
- const se_UpdateCustomLineItemPercentageChargeDetails = (input, context) => {
2658
- return {
2659
- ...(input.PercentageValue != null && { PercentageValue: __serializeFloat(input.PercentageValue) }),
2660
- };
2661
- };
2662
- const se_UpdateFreeTierConfig = (input, context) => {
2663
- return {
2664
- ...(input.Activated != null && { Activated: input.Activated }),
2665
- };
2666
- };
2667
- const se_UpdateTieringInput = (input, context) => {
2668
- return {
2669
- ...(input.FreeTier != null && { FreeTier: se_UpdateFreeTierConfig(input.FreeTier, context) }),
2670
- };
2671
- };
2672
- const de_AccountAssociationsList = (output, context) => {
2673
- const retVal = (output || [])
2674
- .filter((e) => e != null)
2675
- .map((entry) => {
2676
- if (entry === null) {
2677
- return null;
2678
- }
2679
- return de_AccountAssociationsListElement(entry, context);
2680
- });
2681
- return retVal;
2682
- };
2683
- const de_AccountAssociationsListElement = (output, context) => {
2684
- return {
2685
- AccountEmail: __expectString(output.AccountEmail),
2686
- AccountId: __expectString(output.AccountId),
2687
- AccountName: __expectString(output.AccountName),
2688
- BillingGroupArn: __expectString(output.BillingGroupArn),
2689
- };
2690
- };
2691
- const de_AssociateResourceError = (output, context) => {
2692
- return {
2693
- Message: __expectString(output.Message),
2694
- Reason: __expectString(output.Reason),
2695
- };
2696
- };
2697
- const de_AssociateResourceResponseElement = (output, context) => {
2698
- return {
2699
- Arn: __expectString(output.Arn),
2700
- Error: output.Error != null ? de_AssociateResourceError(output.Error, context) : undefined,
2701
- };
2702
- };
2703
- const de_AssociateResourcesResponseList = (output, context) => {
2704
- const retVal = (output || [])
2705
- .filter((e) => e != null)
2706
- .map((entry) => {
2707
- if (entry === null) {
2708
- return null;
2709
- }
2710
- return de_AssociateResourceResponseElement(entry, context);
2318
+ return take(input, {
2319
+ Flat: (_) => se_UpdateCustomLineItemFlatChargeDetails(_, context),
2320
+ Percentage: (_) => se_UpdateCustomLineItemPercentageChargeDetails(_, context),
2711
2321
  });
2712
- return retVal;
2713
- };
2714
- const de_BillingGroupCostReportElement = (output, context) => {
2715
- return {
2716
- AWSCost: __expectString(output.AWSCost),
2717
- Arn: __expectString(output.Arn),
2718
- Currency: __expectString(output.Currency),
2719
- Margin: __expectString(output.Margin),
2720
- MarginPercentage: __expectString(output.MarginPercentage),
2721
- ProformaCost: __expectString(output.ProformaCost),
2722
- };
2723
2322
  };
2724
- const de_BillingGroupCostReportList = (output, context) => {
2725
- const retVal = (output || [])
2726
- .filter((e) => e != null)
2727
- .map((entry) => {
2728
- if (entry === null) {
2729
- return null;
2730
- }
2731
- return de_BillingGroupCostReportElement(entry, context);
2323
+ const se_UpdateCustomLineItemFlatChargeDetails = (input, context) => {
2324
+ return take(input, {
2325
+ ChargeValue: __serializeFloat,
2732
2326
  });
2733
- return retVal;
2734
2327
  };
2735
- const de_BillingGroupList = (output, context) => {
2736
- const retVal = (output || [])
2737
- .filter((e) => e != null)
2738
- .map((entry) => {
2739
- if (entry === null) {
2740
- return null;
2741
- }
2742
- return de_BillingGroupListElement(entry, context);
2328
+ const se_UpdateCustomLineItemPercentageChargeDetails = (input, context) => {
2329
+ return take(input, {
2330
+ PercentageValue: __serializeFloat,
2743
2331
  });
2744
- return retVal;
2745
- };
2746
- const de_BillingGroupListElement = (output, context) => {
2747
- return {
2748
- Arn: __expectString(output.Arn),
2749
- ComputationPreference: output.ComputationPreference != null
2750
- ? de_ComputationPreference(output.ComputationPreference, context)
2751
- : undefined,
2752
- CreationTime: __expectLong(output.CreationTime),
2753
- Description: __expectString(output.Description),
2754
- LastModifiedTime: __expectLong(output.LastModifiedTime),
2755
- Name: __expectString(output.Name),
2756
- PrimaryAccountId: __expectString(output.PrimaryAccountId),
2757
- Size: __expectLong(output.Size),
2758
- Status: __expectString(output.Status),
2759
- StatusReason: __expectString(output.StatusReason),
2760
- };
2761
- };
2762
- const de_ComputationPreference = (output, context) => {
2763
- return {
2764
- PricingPlanArn: __expectString(output.PricingPlanArn),
2765
- };
2766
2332
  };
2767
2333
  const de_CustomLineItemList = (output, context) => {
2768
2334
  const retVal = (output || [])
2769
2335
  .filter((e) => e != null)
2770
2336
  .map((entry) => {
2771
- if (entry === null) {
2772
- return null;
2773
- }
2774
2337
  return de_CustomLineItemListElement(entry, context);
2775
2338
  });
2776
2339
  return retVal;
2777
2340
  };
2778
2341
  const de_CustomLineItemListElement = (output, context) => {
2779
- return {
2780
- Arn: __expectString(output.Arn),
2781
- AssociationSize: __expectLong(output.AssociationSize),
2782
- BillingGroupArn: __expectString(output.BillingGroupArn),
2783
- ChargeDetails: output.ChargeDetails != null ? de_ListCustomLineItemChargeDetails(output.ChargeDetails, context) : undefined,
2784
- CreationTime: __expectLong(output.CreationTime),
2785
- CurrencyCode: __expectString(output.CurrencyCode),
2786
- Description: __expectString(output.Description),
2787
- LastModifiedTime: __expectLong(output.LastModifiedTime),
2788
- Name: __expectString(output.Name),
2789
- ProductCode: __expectString(output.ProductCode),
2790
- };
2342
+ return take(output, {
2343
+ Arn: __expectString,
2344
+ AssociationSize: __expectLong,
2345
+ BillingGroupArn: __expectString,
2346
+ ChargeDetails: (_) => de_ListCustomLineItemChargeDetails(_, context),
2347
+ CreationTime: __expectLong,
2348
+ CurrencyCode: __expectString,
2349
+ Description: __expectString,
2350
+ LastModifiedTime: __expectLong,
2351
+ Name: __expectString,
2352
+ ProductCode: __expectString,
2353
+ });
2791
2354
  };
2792
2355
  const de_CustomLineItemVersionList = (output, context) => {
2793
2356
  const retVal = (output || [])
2794
2357
  .filter((e) => e != null)
2795
2358
  .map((entry) => {
2796
- if (entry === null) {
2797
- return null;
2798
- }
2799
2359
  return de_CustomLineItemVersionListElement(entry, context);
2800
2360
  });
2801
2361
  return retVal;
2802
2362
  };
2803
2363
  const de_CustomLineItemVersionListElement = (output, context) => {
2804
- return {
2805
- Arn: __expectString(output.Arn),
2806
- AssociationSize: __expectLong(output.AssociationSize),
2807
- BillingGroupArn: __expectString(output.BillingGroupArn),
2808
- ChargeDetails: output.ChargeDetails != null ? de_ListCustomLineItemChargeDetails(output.ChargeDetails, context) : undefined,
2809
- CreationTime: __expectLong(output.CreationTime),
2810
- CurrencyCode: __expectString(output.CurrencyCode),
2811
- Description: __expectString(output.Description),
2812
- EndBillingPeriod: __expectString(output.EndBillingPeriod),
2813
- LastModifiedTime: __expectLong(output.LastModifiedTime),
2814
- Name: __expectString(output.Name),
2815
- ProductCode: __expectString(output.ProductCode),
2816
- StartBillingPeriod: __expectString(output.StartBillingPeriod),
2817
- StartTime: __expectLong(output.StartTime),
2818
- };
2819
- };
2820
- const de_DisassociateResourceResponseElement = (output, context) => {
2821
- return {
2822
- Arn: __expectString(output.Arn),
2823
- Error: output.Error != null ? de_AssociateResourceError(output.Error, context) : undefined,
2824
- };
2825
- };
2826
- const de_DisassociateResourcesResponseList = (output, context) => {
2827
- const retVal = (output || [])
2828
- .filter((e) => e != null)
2829
- .map((entry) => {
2830
- if (entry === null) {
2831
- return null;
2832
- }
2833
- return de_DisassociateResourceResponseElement(entry, context);
2364
+ return take(output, {
2365
+ Arn: __expectString,
2366
+ AssociationSize: __expectLong,
2367
+ BillingGroupArn: __expectString,
2368
+ ChargeDetails: (_) => de_ListCustomLineItemChargeDetails(_, context),
2369
+ CreationTime: __expectLong,
2370
+ CurrencyCode: __expectString,
2371
+ Description: __expectString,
2372
+ EndBillingPeriod: __expectString,
2373
+ LastModifiedTime: __expectLong,
2374
+ Name: __expectString,
2375
+ ProductCode: __expectString,
2376
+ StartBillingPeriod: __expectString,
2377
+ StartTime: __expectLong,
2834
2378
  });
2835
- return retVal;
2836
- };
2837
- const de_FreeTierConfig = (output, context) => {
2838
- return {
2839
- Activated: __expectBoolean(output.Activated),
2840
- };
2841
2379
  };
2842
2380
  const de_ListCustomLineItemChargeDetails = (output, context) => {
2843
- return {
2844
- Flat: output.Flat != null ? de_ListCustomLineItemFlatChargeDetails(output.Flat, context) : undefined,
2845
- Percentage: output.Percentage != null ? de_ListCustomLineItemPercentageChargeDetails(output.Percentage, context) : undefined,
2846
- Type: __expectString(output.Type),
2847
- };
2848
- };
2849
- const de_ListCustomLineItemFlatChargeDetails = (output, context) => {
2850
- return {
2851
- ChargeValue: __limitedParseDouble(output.ChargeValue),
2852
- };
2853
- };
2854
- const de_ListCustomLineItemPercentageChargeDetails = (output, context) => {
2855
- return {
2856
- PercentageValue: __limitedParseDouble(output.PercentageValue),
2857
- };
2858
- };
2859
- const de_ListResourcesAssociatedToCustomLineItemResponseElement = (output, context) => {
2860
- return {
2861
- Arn: __expectString(output.Arn),
2862
- EndBillingPeriod: __expectString(output.EndBillingPeriod),
2863
- Relationship: __expectString(output.Relationship),
2864
- };
2865
- };
2866
- const de_ListResourcesAssociatedToCustomLineItemResponseList = (output, context) => {
2867
- const retVal = (output || [])
2868
- .filter((e) => e != null)
2869
- .map((entry) => {
2870
- if (entry === null) {
2871
- return null;
2872
- }
2873
- return de_ListResourcesAssociatedToCustomLineItemResponseElement(entry, context);
2874
- });
2875
- return retVal;
2876
- };
2877
- const de_PricingPlanArns = (output, context) => {
2878
- const retVal = (output || [])
2879
- .filter((e) => e != null)
2880
- .map((entry) => {
2881
- if (entry === null) {
2882
- return null;
2883
- }
2884
- return __expectString(entry);
2381
+ return take(output, {
2382
+ Flat: (_) => de_ListCustomLineItemFlatChargeDetails(_, context),
2383
+ Percentage: (_) => de_ListCustomLineItemPercentageChargeDetails(_, context),
2384
+ Type: __expectString,
2885
2385
  });
2886
- return retVal;
2887
2386
  };
2888
- const de_PricingPlanList = (output, context) => {
2889
- const retVal = (output || [])
2890
- .filter((e) => e != null)
2891
- .map((entry) => {
2892
- if (entry === null) {
2893
- return null;
2894
- }
2895
- return de_PricingPlanListElement(entry, context);
2387
+ const de_ListCustomLineItemFlatChargeDetails = (output, context) => {
2388
+ return take(output, {
2389
+ ChargeValue: __limitedParseDouble,
2896
2390
  });
2897
- return retVal;
2898
- };
2899
- const de_PricingPlanListElement = (output, context) => {
2900
- return {
2901
- Arn: __expectString(output.Arn),
2902
- CreationTime: __expectLong(output.CreationTime),
2903
- Description: __expectString(output.Description),
2904
- LastModifiedTime: __expectLong(output.LastModifiedTime),
2905
- Name: __expectString(output.Name),
2906
- Size: __expectLong(output.Size),
2907
- };
2908
2391
  };
2909
- const de_PricingRuleArns = (output, context) => {
2910
- const retVal = (output || [])
2911
- .filter((e) => e != null)
2912
- .map((entry) => {
2913
- if (entry === null) {
2914
- return null;
2915
- }
2916
- return __expectString(entry);
2392
+ const de_ListCustomLineItemPercentageChargeDetails = (output, context) => {
2393
+ return take(output, {
2394
+ PercentageValue: __limitedParseDouble,
2917
2395
  });
2918
- return retVal;
2919
2396
  };
2920
2397
  const de_PricingRuleList = (output, context) => {
2921
2398
  const retVal = (output || [])
2922
2399
  .filter((e) => e != null)
2923
2400
  .map((entry) => {
2924
- if (entry === null) {
2925
- return null;
2926
- }
2927
2401
  return de_PricingRuleListElement(entry, context);
2928
2402
  });
2929
2403
  return retVal;
2930
2404
  };
2931
2405
  const de_PricingRuleListElement = (output, context) => {
2932
- return {
2933
- Arn: __expectString(output.Arn),
2934
- AssociatedPricingPlanCount: __expectLong(output.AssociatedPricingPlanCount),
2935
- BillingEntity: __expectString(output.BillingEntity),
2936
- CreationTime: __expectLong(output.CreationTime),
2937
- Description: __expectString(output.Description),
2938
- LastModifiedTime: __expectLong(output.LastModifiedTime),
2939
- ModifierPercentage: __limitedParseDouble(output.ModifierPercentage),
2940
- Name: __expectString(output.Name),
2941
- Operation: __expectString(output.Operation),
2942
- Scope: __expectString(output.Scope),
2943
- Service: __expectString(output.Service),
2944
- Tiering: output.Tiering != null ? de_Tiering(output.Tiering, context) : undefined,
2945
- Type: __expectString(output.Type),
2946
- UsageType: __expectString(output.UsageType),
2947
- };
2948
- };
2949
- const de_TagMap = (output, context) => {
2950
- return Object.entries(output).reduce((acc, [key, value]) => {
2951
- if (value === null) {
2952
- return acc;
2953
- }
2954
- acc[key] = __expectString(value);
2955
- return acc;
2956
- }, {});
2957
- };
2958
- const de_Tiering = (output, context) => {
2959
- return {
2960
- FreeTier: output.FreeTier != null ? de_FreeTierConfig(output.FreeTier, context) : undefined,
2961
- };
2962
- };
2963
- const de_UpdateFreeTierConfig = (output, context) => {
2964
- return {
2965
- Activated: __expectBoolean(output.Activated),
2966
- };
2967
- };
2968
- const de_UpdateTieringInput = (output, context) => {
2969
- return {
2970
- FreeTier: output.FreeTier != null ? de_UpdateFreeTierConfig(output.FreeTier, context) : undefined,
2971
- };
2972
- };
2973
- const de_ValidationExceptionField = (output, context) => {
2974
- return {
2975
- Message: __expectString(output.Message),
2976
- Name: __expectString(output.Name),
2977
- };
2978
- };
2979
- const de_ValidationExceptionFieldList = (output, context) => {
2980
- const retVal = (output || [])
2981
- .filter((e) => e != null)
2982
- .map((entry) => {
2983
- if (entry === null) {
2984
- return null;
2985
- }
2986
- return de_ValidationExceptionField(entry, context);
2406
+ return take(output, {
2407
+ Arn: __expectString,
2408
+ AssociatedPricingPlanCount: __expectLong,
2409
+ BillingEntity: __expectString,
2410
+ CreationTime: __expectLong,
2411
+ Description: __expectString,
2412
+ LastModifiedTime: __expectLong,
2413
+ ModifierPercentage: __limitedParseDouble,
2414
+ Name: __expectString,
2415
+ Operation: __expectString,
2416
+ Scope: __expectString,
2417
+ Service: __expectString,
2418
+ Tiering: _json,
2419
+ Type: __expectString,
2420
+ UsageType: __expectString,
2987
2421
  });
2988
- return retVal;
2989
2422
  };
2990
2423
  const deserializeMetadata = (output) => ({
2991
2424
  httpStatusCode: output.statusCode,