@aws-sdk/client-marketplace-metering 3.312.0 → 3.315.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.
@@ -22,14 +22,14 @@ exports.se_MeterUsageCommand = se_MeterUsageCommand;
22
22
  const se_RegisterUsageCommand = async (input, context) => {
23
23
  const headers = sharedHeaders("RegisterUsage");
24
24
  let body;
25
- body = JSON.stringify(se_RegisterUsageRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
27
  };
28
28
  exports.se_RegisterUsageCommand = se_RegisterUsageCommand;
29
29
  const se_ResolveCustomerCommand = async (input, context) => {
30
30
  const headers = sharedHeaders("ResolveCustomer");
31
31
  let body;
32
- body = JSON.stringify(se_ResolveCustomerRequest(input, context));
32
+ body = JSON.stringify((0, smithy_client_1._json)(input));
33
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
34
  };
35
35
  exports.se_ResolveCustomerCommand = se_ResolveCustomerCommand;
@@ -44,7 +44,7 @@ const de_BatchMeterUsageCommand = async (output, context) => {
44
44
  $metadata: deserializeMetadata(output),
45
45
  ...contents,
46
46
  };
47
- return Promise.resolve(response);
47
+ return response;
48
48
  };
49
49
  exports.de_BatchMeterUsageCommand = de_BatchMeterUsageCommand;
50
50
  const de_BatchMeterUsageCommandError = async (output, context) => {
@@ -83,10 +83,9 @@ const de_BatchMeterUsageCommandError = async (output, context) => {
83
83
  throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context);
84
84
  default:
85
85
  const parsedBody = parsedOutput.body;
86
- (0, smithy_client_1.throwDefaultError)({
86
+ return throwDefaultError({
87
87
  output,
88
88
  parsedBody,
89
- exceptionCtor: MarketplaceMeteringServiceException_1.MarketplaceMeteringServiceException,
90
89
  errorCode,
91
90
  });
92
91
  }
@@ -97,12 +96,12 @@ const de_MeterUsageCommand = async (output, context) => {
97
96
  }
98
97
  const data = await parseBody(output.body, context);
99
98
  let contents = {};
100
- contents = de_MeterUsageResult(data, context);
99
+ contents = (0, smithy_client_1._json)(data);
101
100
  const response = {
102
101
  $metadata: deserializeMetadata(output),
103
102
  ...contents,
104
103
  };
105
- return Promise.resolve(response);
104
+ return response;
106
105
  };
107
106
  exports.de_MeterUsageCommand = de_MeterUsageCommand;
108
107
  const de_MeterUsageCommandError = async (output, context) => {
@@ -144,10 +143,9 @@ const de_MeterUsageCommandError = async (output, context) => {
144
143
  throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context);
145
144
  default:
146
145
  const parsedBody = parsedOutput.body;
147
- (0, smithy_client_1.throwDefaultError)({
146
+ return throwDefaultError({
148
147
  output,
149
148
  parsedBody,
150
- exceptionCtor: MarketplaceMeteringServiceException_1.MarketplaceMeteringServiceException,
151
149
  errorCode,
152
150
  });
153
151
  }
@@ -163,7 +161,7 @@ const de_RegisterUsageCommand = async (output, context) => {
163
161
  $metadata: deserializeMetadata(output),
164
162
  ...contents,
165
163
  };
166
- return Promise.resolve(response);
164
+ return response;
167
165
  };
168
166
  exports.de_RegisterUsageCommand = de_RegisterUsageCommand;
169
167
  const de_RegisterUsageCommandError = async (output, context) => {
@@ -199,10 +197,9 @@ const de_RegisterUsageCommandError = async (output, context) => {
199
197
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
200
198
  default:
201
199
  const parsedBody = parsedOutput.body;
202
- (0, smithy_client_1.throwDefaultError)({
200
+ return throwDefaultError({
203
201
  output,
204
202
  parsedBody,
205
- exceptionCtor: MarketplaceMeteringServiceException_1.MarketplaceMeteringServiceException,
206
203
  errorCode,
207
204
  });
208
205
  }
@@ -213,12 +210,12 @@ const de_ResolveCustomerCommand = async (output, context) => {
213
210
  }
214
211
  const data = await parseBody(output.body, context);
215
212
  let contents = {};
216
- contents = de_ResolveCustomerResult(data, context);
213
+ contents = (0, smithy_client_1._json)(data);
217
214
  const response = {
218
215
  $metadata: deserializeMetadata(output),
219
216
  ...contents,
220
217
  };
221
- return Promise.resolve(response);
218
+ return response;
222
219
  };
223
220
  exports.de_ResolveCustomerCommand = de_ResolveCustomerCommand;
224
221
  const de_ResolveCustomerCommandError = async (output, context) => {
@@ -245,17 +242,16 @@ const de_ResolveCustomerCommandError = async (output, context) => {
245
242
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
246
243
  default:
247
244
  const parsedBody = parsedOutput.body;
248
- (0, smithy_client_1.throwDefaultError)({
245
+ return throwDefaultError({
249
246
  output,
250
247
  parsedBody,
251
- exceptionCtor: MarketplaceMeteringServiceException_1.MarketplaceMeteringServiceException,
252
248
  errorCode,
253
249
  });
254
250
  }
255
251
  };
256
252
  const de_CustomerNotEntitledExceptionRes = async (parsedOutput, context) => {
257
253
  const body = parsedOutput.body;
258
- const deserialized = de_CustomerNotEntitledException(body, context);
254
+ const deserialized = (0, smithy_client_1._json)(body);
259
255
  const exception = new models_0_1.CustomerNotEntitledException({
260
256
  $metadata: deserializeMetadata(parsedOutput),
261
257
  ...deserialized,
@@ -264,7 +260,7 @@ const de_CustomerNotEntitledExceptionRes = async (parsedOutput, context) => {
264
260
  };
265
261
  const de_DisabledApiExceptionRes = async (parsedOutput, context) => {
266
262
  const body = parsedOutput.body;
267
- const deserialized = de_DisabledApiException(body, context);
263
+ const deserialized = (0, smithy_client_1._json)(body);
268
264
  const exception = new models_0_1.DisabledApiException({
269
265
  $metadata: deserializeMetadata(parsedOutput),
270
266
  ...deserialized,
@@ -273,7 +269,7 @@ const de_DisabledApiExceptionRes = async (parsedOutput, context) => {
273
269
  };
274
270
  const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
275
271
  const body = parsedOutput.body;
276
- const deserialized = de_DuplicateRequestException(body, context);
272
+ const deserialized = (0, smithy_client_1._json)(body);
277
273
  const exception = new models_0_1.DuplicateRequestException({
278
274
  $metadata: deserializeMetadata(parsedOutput),
279
275
  ...deserialized,
@@ -282,7 +278,7 @@ const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
282
278
  };
283
279
  const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
284
280
  const body = parsedOutput.body;
285
- const deserialized = de_ExpiredTokenException(body, context);
281
+ const deserialized = (0, smithy_client_1._json)(body);
286
282
  const exception = new models_0_1.ExpiredTokenException({
287
283
  $metadata: deserializeMetadata(parsedOutput),
288
284
  ...deserialized,
@@ -291,7 +287,7 @@ const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
291
287
  };
292
288
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
293
289
  const body = parsedOutput.body;
294
- const deserialized = de_InternalServiceErrorException(body, context);
290
+ const deserialized = (0, smithy_client_1._json)(body);
295
291
  const exception = new models_0_1.InternalServiceErrorException({
296
292
  $metadata: deserializeMetadata(parsedOutput),
297
293
  ...deserialized,
@@ -300,7 +296,7 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
300
296
  };
301
297
  const de_InvalidCustomerIdentifierExceptionRes = async (parsedOutput, context) => {
302
298
  const body = parsedOutput.body;
303
- const deserialized = de_InvalidCustomerIdentifierException(body, context);
299
+ const deserialized = (0, smithy_client_1._json)(body);
304
300
  const exception = new models_0_1.InvalidCustomerIdentifierException({
305
301
  $metadata: deserializeMetadata(parsedOutput),
306
302
  ...deserialized,
@@ -309,7 +305,7 @@ const de_InvalidCustomerIdentifierExceptionRes = async (parsedOutput, context) =
309
305
  };
310
306
  const de_InvalidEndpointRegionExceptionRes = async (parsedOutput, context) => {
311
307
  const body = parsedOutput.body;
312
- const deserialized = de_InvalidEndpointRegionException(body, context);
308
+ const deserialized = (0, smithy_client_1._json)(body);
313
309
  const exception = new models_0_1.InvalidEndpointRegionException({
314
310
  $metadata: deserializeMetadata(parsedOutput),
315
311
  ...deserialized,
@@ -318,7 +314,7 @@ const de_InvalidEndpointRegionExceptionRes = async (parsedOutput, context) => {
318
314
  };
319
315
  const de_InvalidProductCodeExceptionRes = async (parsedOutput, context) => {
320
316
  const body = parsedOutput.body;
321
- const deserialized = de_InvalidProductCodeException(body, context);
317
+ const deserialized = (0, smithy_client_1._json)(body);
322
318
  const exception = new models_0_1.InvalidProductCodeException({
323
319
  $metadata: deserializeMetadata(parsedOutput),
324
320
  ...deserialized,
@@ -327,7 +323,7 @@ const de_InvalidProductCodeExceptionRes = async (parsedOutput, context) => {
327
323
  };
328
324
  const de_InvalidPublicKeyVersionExceptionRes = async (parsedOutput, context) => {
329
325
  const body = parsedOutput.body;
330
- const deserialized = de_InvalidPublicKeyVersionException(body, context);
326
+ const deserialized = (0, smithy_client_1._json)(body);
331
327
  const exception = new models_0_1.InvalidPublicKeyVersionException({
332
328
  $metadata: deserializeMetadata(parsedOutput),
333
329
  ...deserialized,
@@ -336,7 +332,7 @@ const de_InvalidPublicKeyVersionExceptionRes = async (parsedOutput, context) =>
336
332
  };
337
333
  const de_InvalidRegionExceptionRes = async (parsedOutput, context) => {
338
334
  const body = parsedOutput.body;
339
- const deserialized = de_InvalidRegionException(body, context);
335
+ const deserialized = (0, smithy_client_1._json)(body);
340
336
  const exception = new models_0_1.InvalidRegionException({
341
337
  $metadata: deserializeMetadata(parsedOutput),
342
338
  ...deserialized,
@@ -345,7 +341,7 @@ const de_InvalidRegionExceptionRes = async (parsedOutput, context) => {
345
341
  };
346
342
  const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
347
343
  const body = parsedOutput.body;
348
- const deserialized = de_InvalidTagException(body, context);
344
+ const deserialized = (0, smithy_client_1._json)(body);
349
345
  const exception = new models_0_1.InvalidTagException({
350
346
  $metadata: deserializeMetadata(parsedOutput),
351
347
  ...deserialized,
@@ -354,7 +350,7 @@ const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
354
350
  };
355
351
  const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
356
352
  const body = parsedOutput.body;
357
- const deserialized = de_InvalidTokenException(body, context);
353
+ const deserialized = (0, smithy_client_1._json)(body);
358
354
  const exception = new models_0_1.InvalidTokenException({
359
355
  $metadata: deserializeMetadata(parsedOutput),
360
356
  ...deserialized,
@@ -363,7 +359,7 @@ const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
363
359
  };
364
360
  const de_InvalidUsageAllocationsExceptionRes = async (parsedOutput, context) => {
365
361
  const body = parsedOutput.body;
366
- const deserialized = de_InvalidUsageAllocationsException(body, context);
362
+ const deserialized = (0, smithy_client_1._json)(body);
367
363
  const exception = new models_0_1.InvalidUsageAllocationsException({
368
364
  $metadata: deserializeMetadata(parsedOutput),
369
365
  ...deserialized,
@@ -372,7 +368,7 @@ const de_InvalidUsageAllocationsExceptionRes = async (parsedOutput, context) =>
372
368
  };
373
369
  const de_InvalidUsageDimensionExceptionRes = async (parsedOutput, context) => {
374
370
  const body = parsedOutput.body;
375
- const deserialized = de_InvalidUsageDimensionException(body, context);
371
+ const deserialized = (0, smithy_client_1._json)(body);
376
372
  const exception = new models_0_1.InvalidUsageDimensionException({
377
373
  $metadata: deserializeMetadata(parsedOutput),
378
374
  ...deserialized,
@@ -381,7 +377,7 @@ const de_InvalidUsageDimensionExceptionRes = async (parsedOutput, context) => {
381
377
  };
382
378
  const de_PlatformNotSupportedExceptionRes = async (parsedOutput, context) => {
383
379
  const body = parsedOutput.body;
384
- const deserialized = de_PlatformNotSupportedException(body, context);
380
+ const deserialized = (0, smithy_client_1._json)(body);
385
381
  const exception = new models_0_1.PlatformNotSupportedException({
386
382
  $metadata: deserializeMetadata(parsedOutput),
387
383
  ...deserialized,
@@ -390,7 +386,7 @@ const de_PlatformNotSupportedExceptionRes = async (parsedOutput, context) => {
390
386
  };
391
387
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
392
388
  const body = parsedOutput.body;
393
- const deserialized = de_ThrottlingException(body, context);
389
+ const deserialized = (0, smithy_client_1._json)(body);
394
390
  const exception = new models_0_1.ThrottlingException({
395
391
  $metadata: deserializeMetadata(parsedOutput),
396
392
  ...deserialized,
@@ -399,7 +395,7 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
399
395
  };
400
396
  const de_TimestampOutOfBoundsExceptionRes = async (parsedOutput, context) => {
401
397
  const body = parsedOutput.body;
402
- const deserialized = de_TimestampOutOfBoundsException(body, context);
398
+ const deserialized = (0, smithy_client_1._json)(body);
403
399
  const exception = new models_0_1.TimestampOutOfBoundsException({
404
400
  $metadata: deserializeMetadata(parsedOutput),
405
401
  ...deserialized,
@@ -407,67 +403,29 @@ const de_TimestampOutOfBoundsExceptionRes = async (parsedOutput, context) => {
407
403
  return (0, smithy_client_1.decorateServiceException)(exception, body);
408
404
  };
409
405
  const se_BatchMeterUsageRequest = (input, context) => {
410
- return {
411
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
412
- ...(input.UsageRecords != null && { UsageRecords: se_UsageRecordList(input.UsageRecords, context) }),
413
- };
414
- };
415
- const se_MeterUsageRequest = (input, context) => {
416
- return {
417
- ...(input.DryRun != null && { DryRun: input.DryRun }),
418
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
419
- ...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
420
- ...(input.UsageAllocations != null && { UsageAllocations: se_UsageAllocations(input.UsageAllocations, context) }),
421
- ...(input.UsageDimension != null && { UsageDimension: input.UsageDimension }),
422
- ...(input.UsageQuantity != null && { UsageQuantity: input.UsageQuantity }),
423
- };
424
- };
425
- const se_RegisterUsageRequest = (input, context) => {
426
- return {
427
- ...(input.Nonce != null && { Nonce: input.Nonce }),
428
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
429
- ...(input.PublicKeyVersion != null && { PublicKeyVersion: input.PublicKeyVersion }),
430
- };
431
- };
432
- const se_ResolveCustomerRequest = (input, context) => {
433
- return {
434
- ...(input.RegistrationToken != null && { RegistrationToken: input.RegistrationToken }),
435
- };
436
- };
437
- const se_Tag = (input, context) => {
438
- return {
439
- ...(input.Key != null && { Key: input.Key }),
440
- ...(input.Value != null && { Value: input.Value }),
441
- };
442
- };
443
- const se_TagList = (input, context) => {
444
- return input
445
- .filter((e) => e != null)
446
- .map((entry) => {
447
- return se_Tag(entry, context);
406
+ return (0, smithy_client_1.take)(input, {
407
+ ProductCode: [],
408
+ UsageRecords: (_) => se_UsageRecordList(_, context),
448
409
  });
449
410
  };
450
- const se_UsageAllocation = (input, context) => {
451
- return {
452
- ...(input.AllocatedUsageQuantity != null && { AllocatedUsageQuantity: input.AllocatedUsageQuantity }),
453
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
454
- };
455
- };
456
- const se_UsageAllocations = (input, context) => {
457
- return input
458
- .filter((e) => e != null)
459
- .map((entry) => {
460
- return se_UsageAllocation(entry, context);
411
+ const se_MeterUsageRequest = (input, context) => {
412
+ return (0, smithy_client_1.take)(input, {
413
+ DryRun: [],
414
+ ProductCode: [],
415
+ Timestamp: (_) => Math.round(_.getTime() / 1000),
416
+ UsageAllocations: smithy_client_1._json,
417
+ UsageDimension: [],
418
+ UsageQuantity: [],
461
419
  });
462
420
  };
463
421
  const se_UsageRecord = (input, context) => {
464
- return {
465
- ...(input.CustomerIdentifier != null && { CustomerIdentifier: input.CustomerIdentifier }),
466
- ...(input.Dimension != null && { Dimension: input.Dimension }),
467
- ...(input.Quantity != null && { Quantity: input.Quantity }),
468
- ...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
469
- ...(input.UsageAllocations != null && { UsageAllocations: se_UsageAllocations(input.UsageAllocations, context) }),
470
- };
422
+ return (0, smithy_client_1.take)(input, {
423
+ CustomerIdentifier: [],
424
+ Dimension: [],
425
+ Quantity: [],
426
+ Timestamp: (_) => Math.round(_.getTime() / 1000),
427
+ UsageAllocations: smithy_client_1._json,
428
+ });
471
429
  };
472
430
  const se_UsageRecordList = (input, context) => {
473
431
  return input
@@ -477,184 +435,45 @@ const se_UsageRecordList = (input, context) => {
477
435
  });
478
436
  };
479
437
  const de_BatchMeterUsageResult = (output, context) => {
480
- return {
481
- Results: output.Results != null ? de_UsageRecordResultList(output.Results, context) : undefined,
482
- UnprocessedRecords: output.UnprocessedRecords != null ? de_UsageRecordList(output.UnprocessedRecords, context) : undefined,
483
- };
484
- };
485
- const de_CustomerNotEntitledException = (output, context) => {
486
- return {
487
- message: (0, smithy_client_1.expectString)(output.message),
488
- };
489
- };
490
- const de_DisabledApiException = (output, context) => {
491
- return {
492
- message: (0, smithy_client_1.expectString)(output.message),
493
- };
494
- };
495
- const de_DuplicateRequestException = (output, context) => {
496
- return {
497
- message: (0, smithy_client_1.expectString)(output.message),
498
- };
499
- };
500
- const de_ExpiredTokenException = (output, context) => {
501
- return {
502
- message: (0, smithy_client_1.expectString)(output.message),
503
- };
504
- };
505
- const de_InternalServiceErrorException = (output, context) => {
506
- return {
507
- message: (0, smithy_client_1.expectString)(output.message),
508
- };
509
- };
510
- const de_InvalidCustomerIdentifierException = (output, context) => {
511
- return {
512
- message: (0, smithy_client_1.expectString)(output.message),
513
- };
514
- };
515
- const de_InvalidEndpointRegionException = (output, context) => {
516
- return {
517
- message: (0, smithy_client_1.expectString)(output.message),
518
- };
519
- };
520
- const de_InvalidProductCodeException = (output, context) => {
521
- return {
522
- message: (0, smithy_client_1.expectString)(output.message),
523
- };
524
- };
525
- const de_InvalidPublicKeyVersionException = (output, context) => {
526
- return {
527
- message: (0, smithy_client_1.expectString)(output.message),
528
- };
529
- };
530
- const de_InvalidRegionException = (output, context) => {
531
- return {
532
- message: (0, smithy_client_1.expectString)(output.message),
533
- };
534
- };
535
- const de_InvalidTagException = (output, context) => {
536
- return {
537
- message: (0, smithy_client_1.expectString)(output.message),
538
- };
539
- };
540
- const de_InvalidTokenException = (output, context) => {
541
- return {
542
- message: (0, smithy_client_1.expectString)(output.message),
543
- };
544
- };
545
- const de_InvalidUsageAllocationsException = (output, context) => {
546
- return {
547
- message: (0, smithy_client_1.expectString)(output.message),
548
- };
549
- };
550
- const de_InvalidUsageDimensionException = (output, context) => {
551
- return {
552
- message: (0, smithy_client_1.expectString)(output.message),
553
- };
554
- };
555
- const de_MeterUsageResult = (output, context) => {
556
- return {
557
- MeteringRecordId: (0, smithy_client_1.expectString)(output.MeteringRecordId),
558
- };
559
- };
560
- const de_PlatformNotSupportedException = (output, context) => {
561
- return {
562
- message: (0, smithy_client_1.expectString)(output.message),
563
- };
564
- };
565
- const de_RegisterUsageResult = (output, context) => {
566
- return {
567
- PublicKeyRotationTimestamp: output.PublicKeyRotationTimestamp != null
568
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.PublicKeyRotationTimestamp)))
569
- : undefined,
570
- Signature: (0, smithy_client_1.expectString)(output.Signature),
571
- };
572
- };
573
- const de_ResolveCustomerResult = (output, context) => {
574
- return {
575
- CustomerAWSAccountId: (0, smithy_client_1.expectString)(output.CustomerAWSAccountId),
576
- CustomerIdentifier: (0, smithy_client_1.expectString)(output.CustomerIdentifier),
577
- ProductCode: (0, smithy_client_1.expectString)(output.ProductCode),
578
- };
579
- };
580
- const de_Tag = (output, context) => {
581
- return {
582
- Key: (0, smithy_client_1.expectString)(output.Key),
583
- Value: (0, smithy_client_1.expectString)(output.Value),
584
- };
585
- };
586
- const de_TagList = (output, context) => {
587
- const retVal = (output || [])
588
- .filter((e) => e != null)
589
- .map((entry) => {
590
- if (entry === null) {
591
- return null;
592
- }
593
- return de_Tag(entry, context);
438
+ return (0, smithy_client_1.take)(output, {
439
+ Results: (_) => de_UsageRecordResultList(_, context),
440
+ UnprocessedRecords: (_) => de_UsageRecordList(_, context),
594
441
  });
595
- return retVal;
596
- };
597
- const de_ThrottlingException = (output, context) => {
598
- return {
599
- message: (0, smithy_client_1.expectString)(output.message),
600
- };
601
- };
602
- const de_TimestampOutOfBoundsException = (output, context) => {
603
- return {
604
- message: (0, smithy_client_1.expectString)(output.message),
605
- };
606
- };
607
- const de_UsageAllocation = (output, context) => {
608
- return {
609
- AllocatedUsageQuantity: (0, smithy_client_1.expectInt32)(output.AllocatedUsageQuantity),
610
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
611
- };
612
442
  };
613
- const de_UsageAllocations = (output, context) => {
614
- const retVal = (output || [])
615
- .filter((e) => e != null)
616
- .map((entry) => {
617
- if (entry === null) {
618
- return null;
619
- }
620
- return de_UsageAllocation(entry, context);
443
+ const de_RegisterUsageResult = (output, context) => {
444
+ return (0, smithy_client_1.take)(output, {
445
+ PublicKeyRotationTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
446
+ Signature: smithy_client_1.expectString,
621
447
  });
622
- return retVal;
623
448
  };
624
449
  const de_UsageRecord = (output, context) => {
625
- return {
626
- CustomerIdentifier: (0, smithy_client_1.expectString)(output.CustomerIdentifier),
627
- Dimension: (0, smithy_client_1.expectString)(output.Dimension),
628
- Quantity: (0, smithy_client_1.expectInt32)(output.Quantity),
629
- Timestamp: output.Timestamp != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.Timestamp))) : undefined,
630
- UsageAllocations: output.UsageAllocations != null ? de_UsageAllocations(output.UsageAllocations, context) : undefined,
631
- };
450
+ return (0, smithy_client_1.take)(output, {
451
+ CustomerIdentifier: smithy_client_1.expectString,
452
+ Dimension: smithy_client_1.expectString,
453
+ Quantity: smithy_client_1.expectInt32,
454
+ Timestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
455
+ UsageAllocations: smithy_client_1._json,
456
+ });
632
457
  };
633
458
  const de_UsageRecordList = (output, context) => {
634
459
  const retVal = (output || [])
635
460
  .filter((e) => e != null)
636
461
  .map((entry) => {
637
- if (entry === null) {
638
- return null;
639
- }
640
462
  return de_UsageRecord(entry, context);
641
463
  });
642
464
  return retVal;
643
465
  };
644
466
  const de_UsageRecordResult = (output, context) => {
645
- return {
646
- MeteringRecordId: (0, smithy_client_1.expectString)(output.MeteringRecordId),
647
- Status: (0, smithy_client_1.expectString)(output.Status),
648
- UsageRecord: output.UsageRecord != null ? de_UsageRecord(output.UsageRecord, context) : undefined,
649
- };
467
+ return (0, smithy_client_1.take)(output, {
468
+ MeteringRecordId: smithy_client_1.expectString,
469
+ Status: smithy_client_1.expectString,
470
+ UsageRecord: (_) => de_UsageRecord(_, context),
471
+ });
650
472
  };
651
473
  const de_UsageRecordResultList = (output, context) => {
652
474
  const retVal = (output || [])
653
475
  .filter((e) => e != null)
654
476
  .map((entry) => {
655
- if (entry === null) {
656
- return null;
657
- }
658
477
  return de_UsageRecordResult(entry, context);
659
478
  });
660
479
  return retVal;
@@ -672,6 +491,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
672
491
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
673
492
  };
674
493
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
494
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MarketplaceMeteringServiceException_1.MarketplaceMeteringServiceException);
675
495
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
676
496
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
677
497
  const contents = {
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { MarketplaceMeteringServiceException as __BaseException } from "../models/MarketplaceMeteringServiceException";
4
4
  import { CustomerNotEntitledException, DisabledApiException, DuplicateRequestException, ExpiredTokenException, InternalServiceErrorException, InvalidCustomerIdentifierException, InvalidEndpointRegionException, InvalidProductCodeException, InvalidPublicKeyVersionException, InvalidRegionException, InvalidTagException, InvalidTokenException, InvalidUsageAllocationsException, InvalidUsageDimensionException, PlatformNotSupportedException, ThrottlingException, TimestampOutOfBoundsException, } from "../models/models_0";
5
5
  export const se_BatchMeterUsageCommand = async (input, context) => {
@@ -17,13 +17,13 @@ export const se_MeterUsageCommand = async (input, context) => {
17
17
  export const se_RegisterUsageCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("RegisterUsage");
19
19
  let body;
20
- body = JSON.stringify(se_RegisterUsageRequest(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const se_ResolveCustomerCommand = async (input, context) => {
24
24
  const headers = sharedHeaders("ResolveCustomer");
25
25
  let body;
26
- body = JSON.stringify(se_ResolveCustomerRequest(input, context));
26
+ body = JSON.stringify(_json(input));
27
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
28
  };
29
29
  export const de_BatchMeterUsageCommand = async (output, context) => {
@@ -37,7 +37,7 @@ export const de_BatchMeterUsageCommand = async (output, context) => {
37
37
  $metadata: deserializeMetadata(output),
38
38
  ...contents,
39
39
  };
40
- return Promise.resolve(response);
40
+ return response;
41
41
  };
42
42
  const de_BatchMeterUsageCommandError = async (output, context) => {
43
43
  const parsedOutput = {
@@ -75,10 +75,9 @@ const de_BatchMeterUsageCommandError = async (output, context) => {
75
75
  throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context);
76
76
  default:
77
77
  const parsedBody = parsedOutput.body;
78
- throwDefaultError({
78
+ return throwDefaultError({
79
79
  output,
80
80
  parsedBody,
81
- exceptionCtor: __BaseException,
82
81
  errorCode,
83
82
  });
84
83
  }
@@ -89,12 +88,12 @@ export const de_MeterUsageCommand = async (output, context) => {
89
88
  }
90
89
  const data = await parseBody(output.body, context);
91
90
  let contents = {};
92
- contents = de_MeterUsageResult(data, context);
91
+ contents = _json(data);
93
92
  const response = {
94
93
  $metadata: deserializeMetadata(output),
95
94
  ...contents,
96
95
  };
97
- return Promise.resolve(response);
96
+ return response;
98
97
  };
99
98
  const de_MeterUsageCommandError = async (output, context) => {
100
99
  const parsedOutput = {
@@ -135,10 +134,9 @@ const de_MeterUsageCommandError = async (output, context) => {
135
134
  throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context);
136
135
  default:
137
136
  const parsedBody = parsedOutput.body;
138
- throwDefaultError({
137
+ return throwDefaultError({
139
138
  output,
140
139
  parsedBody,
141
- exceptionCtor: __BaseException,
142
140
  errorCode,
143
141
  });
144
142
  }
@@ -154,7 +152,7 @@ export const de_RegisterUsageCommand = async (output, context) => {
154
152
  $metadata: deserializeMetadata(output),
155
153
  ...contents,
156
154
  };
157
- return Promise.resolve(response);
155
+ return response;
158
156
  };
159
157
  const de_RegisterUsageCommandError = async (output, context) => {
160
158
  const parsedOutput = {
@@ -189,10 +187,9 @@ const de_RegisterUsageCommandError = async (output, context) => {
189
187
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
190
188
  default:
191
189
  const parsedBody = parsedOutput.body;
192
- throwDefaultError({
190
+ return throwDefaultError({
193
191
  output,
194
192
  parsedBody,
195
- exceptionCtor: __BaseException,
196
193
  errorCode,
197
194
  });
198
195
  }
@@ -203,12 +200,12 @@ export const de_ResolveCustomerCommand = async (output, context) => {
203
200
  }
204
201
  const data = await parseBody(output.body, context);
205
202
  let contents = {};
206
- contents = de_ResolveCustomerResult(data, context);
203
+ contents = _json(data);
207
204
  const response = {
208
205
  $metadata: deserializeMetadata(output),
209
206
  ...contents,
210
207
  };
211
- return Promise.resolve(response);
208
+ return response;
212
209
  };
213
210
  const de_ResolveCustomerCommandError = async (output, context) => {
214
211
  const parsedOutput = {
@@ -234,17 +231,16 @@ const de_ResolveCustomerCommandError = async (output, context) => {
234
231
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
235
232
  default:
236
233
  const parsedBody = parsedOutput.body;
237
- throwDefaultError({
234
+ return throwDefaultError({
238
235
  output,
239
236
  parsedBody,
240
- exceptionCtor: __BaseException,
241
237
  errorCode,
242
238
  });
243
239
  }
244
240
  };
245
241
  const de_CustomerNotEntitledExceptionRes = async (parsedOutput, context) => {
246
242
  const body = parsedOutput.body;
247
- const deserialized = de_CustomerNotEntitledException(body, context);
243
+ const deserialized = _json(body);
248
244
  const exception = new CustomerNotEntitledException({
249
245
  $metadata: deserializeMetadata(parsedOutput),
250
246
  ...deserialized,
@@ -253,7 +249,7 @@ const de_CustomerNotEntitledExceptionRes = async (parsedOutput, context) => {
253
249
  };
254
250
  const de_DisabledApiExceptionRes = async (parsedOutput, context) => {
255
251
  const body = parsedOutput.body;
256
- const deserialized = de_DisabledApiException(body, context);
252
+ const deserialized = _json(body);
257
253
  const exception = new DisabledApiException({
258
254
  $metadata: deserializeMetadata(parsedOutput),
259
255
  ...deserialized,
@@ -262,7 +258,7 @@ const de_DisabledApiExceptionRes = async (parsedOutput, context) => {
262
258
  };
263
259
  const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
264
260
  const body = parsedOutput.body;
265
- const deserialized = de_DuplicateRequestException(body, context);
261
+ const deserialized = _json(body);
266
262
  const exception = new DuplicateRequestException({
267
263
  $metadata: deserializeMetadata(parsedOutput),
268
264
  ...deserialized,
@@ -271,7 +267,7 @@ const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
271
267
  };
272
268
  const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
273
269
  const body = parsedOutput.body;
274
- const deserialized = de_ExpiredTokenException(body, context);
270
+ const deserialized = _json(body);
275
271
  const exception = new ExpiredTokenException({
276
272
  $metadata: deserializeMetadata(parsedOutput),
277
273
  ...deserialized,
@@ -280,7 +276,7 @@ const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
280
276
  };
281
277
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
282
278
  const body = parsedOutput.body;
283
- const deserialized = de_InternalServiceErrorException(body, context);
279
+ const deserialized = _json(body);
284
280
  const exception = new InternalServiceErrorException({
285
281
  $metadata: deserializeMetadata(parsedOutput),
286
282
  ...deserialized,
@@ -289,7 +285,7 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
289
285
  };
290
286
  const de_InvalidCustomerIdentifierExceptionRes = async (parsedOutput, context) => {
291
287
  const body = parsedOutput.body;
292
- const deserialized = de_InvalidCustomerIdentifierException(body, context);
288
+ const deserialized = _json(body);
293
289
  const exception = new InvalidCustomerIdentifierException({
294
290
  $metadata: deserializeMetadata(parsedOutput),
295
291
  ...deserialized,
@@ -298,7 +294,7 @@ const de_InvalidCustomerIdentifierExceptionRes = async (parsedOutput, context) =
298
294
  };
299
295
  const de_InvalidEndpointRegionExceptionRes = async (parsedOutput, context) => {
300
296
  const body = parsedOutput.body;
301
- const deserialized = de_InvalidEndpointRegionException(body, context);
297
+ const deserialized = _json(body);
302
298
  const exception = new InvalidEndpointRegionException({
303
299
  $metadata: deserializeMetadata(parsedOutput),
304
300
  ...deserialized,
@@ -307,7 +303,7 @@ const de_InvalidEndpointRegionExceptionRes = async (parsedOutput, context) => {
307
303
  };
308
304
  const de_InvalidProductCodeExceptionRes = async (parsedOutput, context) => {
309
305
  const body = parsedOutput.body;
310
- const deserialized = de_InvalidProductCodeException(body, context);
306
+ const deserialized = _json(body);
311
307
  const exception = new InvalidProductCodeException({
312
308
  $metadata: deserializeMetadata(parsedOutput),
313
309
  ...deserialized,
@@ -316,7 +312,7 @@ const de_InvalidProductCodeExceptionRes = async (parsedOutput, context) => {
316
312
  };
317
313
  const de_InvalidPublicKeyVersionExceptionRes = async (parsedOutput, context) => {
318
314
  const body = parsedOutput.body;
319
- const deserialized = de_InvalidPublicKeyVersionException(body, context);
315
+ const deserialized = _json(body);
320
316
  const exception = new InvalidPublicKeyVersionException({
321
317
  $metadata: deserializeMetadata(parsedOutput),
322
318
  ...deserialized,
@@ -325,7 +321,7 @@ const de_InvalidPublicKeyVersionExceptionRes = async (parsedOutput, context) =>
325
321
  };
326
322
  const de_InvalidRegionExceptionRes = async (parsedOutput, context) => {
327
323
  const body = parsedOutput.body;
328
- const deserialized = de_InvalidRegionException(body, context);
324
+ const deserialized = _json(body);
329
325
  const exception = new InvalidRegionException({
330
326
  $metadata: deserializeMetadata(parsedOutput),
331
327
  ...deserialized,
@@ -334,7 +330,7 @@ const de_InvalidRegionExceptionRes = async (parsedOutput, context) => {
334
330
  };
335
331
  const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
336
332
  const body = parsedOutput.body;
337
- const deserialized = de_InvalidTagException(body, context);
333
+ const deserialized = _json(body);
338
334
  const exception = new InvalidTagException({
339
335
  $metadata: deserializeMetadata(parsedOutput),
340
336
  ...deserialized,
@@ -343,7 +339,7 @@ const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
343
339
  };
344
340
  const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
345
341
  const body = parsedOutput.body;
346
- const deserialized = de_InvalidTokenException(body, context);
342
+ const deserialized = _json(body);
347
343
  const exception = new InvalidTokenException({
348
344
  $metadata: deserializeMetadata(parsedOutput),
349
345
  ...deserialized,
@@ -352,7 +348,7 @@ const de_InvalidTokenExceptionRes = async (parsedOutput, context) => {
352
348
  };
353
349
  const de_InvalidUsageAllocationsExceptionRes = async (parsedOutput, context) => {
354
350
  const body = parsedOutput.body;
355
- const deserialized = de_InvalidUsageAllocationsException(body, context);
351
+ const deserialized = _json(body);
356
352
  const exception = new InvalidUsageAllocationsException({
357
353
  $metadata: deserializeMetadata(parsedOutput),
358
354
  ...deserialized,
@@ -361,7 +357,7 @@ const de_InvalidUsageAllocationsExceptionRes = async (parsedOutput, context) =>
361
357
  };
362
358
  const de_InvalidUsageDimensionExceptionRes = async (parsedOutput, context) => {
363
359
  const body = parsedOutput.body;
364
- const deserialized = de_InvalidUsageDimensionException(body, context);
360
+ const deserialized = _json(body);
365
361
  const exception = new InvalidUsageDimensionException({
366
362
  $metadata: deserializeMetadata(parsedOutput),
367
363
  ...deserialized,
@@ -370,7 +366,7 @@ const de_InvalidUsageDimensionExceptionRes = async (parsedOutput, context) => {
370
366
  };
371
367
  const de_PlatformNotSupportedExceptionRes = async (parsedOutput, context) => {
372
368
  const body = parsedOutput.body;
373
- const deserialized = de_PlatformNotSupportedException(body, context);
369
+ const deserialized = _json(body);
374
370
  const exception = new PlatformNotSupportedException({
375
371
  $metadata: deserializeMetadata(parsedOutput),
376
372
  ...deserialized,
@@ -379,7 +375,7 @@ const de_PlatformNotSupportedExceptionRes = async (parsedOutput, context) => {
379
375
  };
380
376
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
381
377
  const body = parsedOutput.body;
382
- const deserialized = de_ThrottlingException(body, context);
378
+ const deserialized = _json(body);
383
379
  const exception = new ThrottlingException({
384
380
  $metadata: deserializeMetadata(parsedOutput),
385
381
  ...deserialized,
@@ -388,7 +384,7 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
388
384
  };
389
385
  const de_TimestampOutOfBoundsExceptionRes = async (parsedOutput, context) => {
390
386
  const body = parsedOutput.body;
391
- const deserialized = de_TimestampOutOfBoundsException(body, context);
387
+ const deserialized = _json(body);
392
388
  const exception = new TimestampOutOfBoundsException({
393
389
  $metadata: deserializeMetadata(parsedOutput),
394
390
  ...deserialized,
@@ -396,67 +392,29 @@ const de_TimestampOutOfBoundsExceptionRes = async (parsedOutput, context) => {
396
392
  return __decorateServiceException(exception, body);
397
393
  };
398
394
  const se_BatchMeterUsageRequest = (input, context) => {
399
- return {
400
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
401
- ...(input.UsageRecords != null && { UsageRecords: se_UsageRecordList(input.UsageRecords, context) }),
402
- };
403
- };
404
- const se_MeterUsageRequest = (input, context) => {
405
- return {
406
- ...(input.DryRun != null && { DryRun: input.DryRun }),
407
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
408
- ...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
409
- ...(input.UsageAllocations != null && { UsageAllocations: se_UsageAllocations(input.UsageAllocations, context) }),
410
- ...(input.UsageDimension != null && { UsageDimension: input.UsageDimension }),
411
- ...(input.UsageQuantity != null && { UsageQuantity: input.UsageQuantity }),
412
- };
413
- };
414
- const se_RegisterUsageRequest = (input, context) => {
415
- return {
416
- ...(input.Nonce != null && { Nonce: input.Nonce }),
417
- ...(input.ProductCode != null && { ProductCode: input.ProductCode }),
418
- ...(input.PublicKeyVersion != null && { PublicKeyVersion: input.PublicKeyVersion }),
419
- };
420
- };
421
- const se_ResolveCustomerRequest = (input, context) => {
422
- return {
423
- ...(input.RegistrationToken != null && { RegistrationToken: input.RegistrationToken }),
424
- };
425
- };
426
- const se_Tag = (input, context) => {
427
- return {
428
- ...(input.Key != null && { Key: input.Key }),
429
- ...(input.Value != null && { Value: input.Value }),
430
- };
431
- };
432
- const se_TagList = (input, context) => {
433
- return input
434
- .filter((e) => e != null)
435
- .map((entry) => {
436
- return se_Tag(entry, context);
395
+ return take(input, {
396
+ ProductCode: [],
397
+ UsageRecords: (_) => se_UsageRecordList(_, context),
437
398
  });
438
399
  };
439
- const se_UsageAllocation = (input, context) => {
440
- return {
441
- ...(input.AllocatedUsageQuantity != null && { AllocatedUsageQuantity: input.AllocatedUsageQuantity }),
442
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
443
- };
444
- };
445
- const se_UsageAllocations = (input, context) => {
446
- return input
447
- .filter((e) => e != null)
448
- .map((entry) => {
449
- return se_UsageAllocation(entry, context);
400
+ const se_MeterUsageRequest = (input, context) => {
401
+ return take(input, {
402
+ DryRun: [],
403
+ ProductCode: [],
404
+ Timestamp: (_) => Math.round(_.getTime() / 1000),
405
+ UsageAllocations: _json,
406
+ UsageDimension: [],
407
+ UsageQuantity: [],
450
408
  });
451
409
  };
452
410
  const se_UsageRecord = (input, context) => {
453
- return {
454
- ...(input.CustomerIdentifier != null && { CustomerIdentifier: input.CustomerIdentifier }),
455
- ...(input.Dimension != null && { Dimension: input.Dimension }),
456
- ...(input.Quantity != null && { Quantity: input.Quantity }),
457
- ...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
458
- ...(input.UsageAllocations != null && { UsageAllocations: se_UsageAllocations(input.UsageAllocations, context) }),
459
- };
411
+ return take(input, {
412
+ CustomerIdentifier: [],
413
+ Dimension: [],
414
+ Quantity: [],
415
+ Timestamp: (_) => Math.round(_.getTime() / 1000),
416
+ UsageAllocations: _json,
417
+ });
460
418
  };
461
419
  const se_UsageRecordList = (input, context) => {
462
420
  return input
@@ -466,184 +424,45 @@ const se_UsageRecordList = (input, context) => {
466
424
  });
467
425
  };
468
426
  const de_BatchMeterUsageResult = (output, context) => {
469
- return {
470
- Results: output.Results != null ? de_UsageRecordResultList(output.Results, context) : undefined,
471
- UnprocessedRecords: output.UnprocessedRecords != null ? de_UsageRecordList(output.UnprocessedRecords, context) : undefined,
472
- };
473
- };
474
- const de_CustomerNotEntitledException = (output, context) => {
475
- return {
476
- message: __expectString(output.message),
477
- };
478
- };
479
- const de_DisabledApiException = (output, context) => {
480
- return {
481
- message: __expectString(output.message),
482
- };
483
- };
484
- const de_DuplicateRequestException = (output, context) => {
485
- return {
486
- message: __expectString(output.message),
487
- };
488
- };
489
- const de_ExpiredTokenException = (output, context) => {
490
- return {
491
- message: __expectString(output.message),
492
- };
493
- };
494
- const de_InternalServiceErrorException = (output, context) => {
495
- return {
496
- message: __expectString(output.message),
497
- };
498
- };
499
- const de_InvalidCustomerIdentifierException = (output, context) => {
500
- return {
501
- message: __expectString(output.message),
502
- };
503
- };
504
- const de_InvalidEndpointRegionException = (output, context) => {
505
- return {
506
- message: __expectString(output.message),
507
- };
508
- };
509
- const de_InvalidProductCodeException = (output, context) => {
510
- return {
511
- message: __expectString(output.message),
512
- };
513
- };
514
- const de_InvalidPublicKeyVersionException = (output, context) => {
515
- return {
516
- message: __expectString(output.message),
517
- };
518
- };
519
- const de_InvalidRegionException = (output, context) => {
520
- return {
521
- message: __expectString(output.message),
522
- };
523
- };
524
- const de_InvalidTagException = (output, context) => {
525
- return {
526
- message: __expectString(output.message),
527
- };
528
- };
529
- const de_InvalidTokenException = (output, context) => {
530
- return {
531
- message: __expectString(output.message),
532
- };
533
- };
534
- const de_InvalidUsageAllocationsException = (output, context) => {
535
- return {
536
- message: __expectString(output.message),
537
- };
538
- };
539
- const de_InvalidUsageDimensionException = (output, context) => {
540
- return {
541
- message: __expectString(output.message),
542
- };
543
- };
544
- const de_MeterUsageResult = (output, context) => {
545
- return {
546
- MeteringRecordId: __expectString(output.MeteringRecordId),
547
- };
548
- };
549
- const de_PlatformNotSupportedException = (output, context) => {
550
- return {
551
- message: __expectString(output.message),
552
- };
553
- };
554
- const de_RegisterUsageResult = (output, context) => {
555
- return {
556
- PublicKeyRotationTimestamp: output.PublicKeyRotationTimestamp != null
557
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.PublicKeyRotationTimestamp)))
558
- : undefined,
559
- Signature: __expectString(output.Signature),
560
- };
561
- };
562
- const de_ResolveCustomerResult = (output, context) => {
563
- return {
564
- CustomerAWSAccountId: __expectString(output.CustomerAWSAccountId),
565
- CustomerIdentifier: __expectString(output.CustomerIdentifier),
566
- ProductCode: __expectString(output.ProductCode),
567
- };
568
- };
569
- const de_Tag = (output, context) => {
570
- return {
571
- Key: __expectString(output.Key),
572
- Value: __expectString(output.Value),
573
- };
574
- };
575
- const de_TagList = (output, context) => {
576
- const retVal = (output || [])
577
- .filter((e) => e != null)
578
- .map((entry) => {
579
- if (entry === null) {
580
- return null;
581
- }
582
- return de_Tag(entry, context);
427
+ return take(output, {
428
+ Results: (_) => de_UsageRecordResultList(_, context),
429
+ UnprocessedRecords: (_) => de_UsageRecordList(_, context),
583
430
  });
584
- return retVal;
585
- };
586
- const de_ThrottlingException = (output, context) => {
587
- return {
588
- message: __expectString(output.message),
589
- };
590
- };
591
- const de_TimestampOutOfBoundsException = (output, context) => {
592
- return {
593
- message: __expectString(output.message),
594
- };
595
- };
596
- const de_UsageAllocation = (output, context) => {
597
- return {
598
- AllocatedUsageQuantity: __expectInt32(output.AllocatedUsageQuantity),
599
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
600
- };
601
431
  };
602
- const de_UsageAllocations = (output, context) => {
603
- const retVal = (output || [])
604
- .filter((e) => e != null)
605
- .map((entry) => {
606
- if (entry === null) {
607
- return null;
608
- }
609
- return de_UsageAllocation(entry, context);
432
+ const de_RegisterUsageResult = (output, context) => {
433
+ return take(output, {
434
+ PublicKeyRotationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
435
+ Signature: __expectString,
610
436
  });
611
- return retVal;
612
437
  };
613
438
  const de_UsageRecord = (output, context) => {
614
- return {
615
- CustomerIdentifier: __expectString(output.CustomerIdentifier),
616
- Dimension: __expectString(output.Dimension),
617
- Quantity: __expectInt32(output.Quantity),
618
- Timestamp: output.Timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp))) : undefined,
619
- UsageAllocations: output.UsageAllocations != null ? de_UsageAllocations(output.UsageAllocations, context) : undefined,
620
- };
439
+ return take(output, {
440
+ CustomerIdentifier: __expectString,
441
+ Dimension: __expectString,
442
+ Quantity: __expectInt32,
443
+ Timestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
444
+ UsageAllocations: _json,
445
+ });
621
446
  };
622
447
  const de_UsageRecordList = (output, context) => {
623
448
  const retVal = (output || [])
624
449
  .filter((e) => e != null)
625
450
  .map((entry) => {
626
- if (entry === null) {
627
- return null;
628
- }
629
451
  return de_UsageRecord(entry, context);
630
452
  });
631
453
  return retVal;
632
454
  };
633
455
  const de_UsageRecordResult = (output, context) => {
634
- return {
635
- MeteringRecordId: __expectString(output.MeteringRecordId),
636
- Status: __expectString(output.Status),
637
- UsageRecord: output.UsageRecord != null ? de_UsageRecord(output.UsageRecord, context) : undefined,
638
- };
456
+ return take(output, {
457
+ MeteringRecordId: __expectString,
458
+ Status: __expectString,
459
+ UsageRecord: (_) => de_UsageRecord(_, context),
460
+ });
639
461
  };
640
462
  const de_UsageRecordResultList = (output, context) => {
641
463
  const retVal = (output || [])
642
464
  .filter((e) => e != null)
643
465
  .map((entry) => {
644
- if (entry === null) {
645
- return null;
646
- }
647
466
  return de_UsageRecordResult(entry, context);
648
467
  });
649
468
  return retVal;
@@ -661,6 +480,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
661
480
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
662
481
  };
663
482
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
483
+ const throwDefaultError = withBaseException(__BaseException);
664
484
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
665
485
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
666
486
  const contents = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-marketplace-metering",
3
3
  "description": "AWS SDK for JavaScript Marketplace Metering Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.312.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",