@aws-sdk/client-savingsplans 3.51.0 → 3.54.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.
- package/CHANGELOG.md +27 -0
- package/dist-cjs/index.js +3 -0
- package/dist-cjs/models/SavingsplansServiceException.js +11 -0
- package/dist-cjs/models/models_0.js +54 -1
- package/dist-cjs/protocols/Aws_restJson1.js +104 -282
- package/dist-es/index.js +1 -0
- package/dist-es/models/SavingsplansServiceException.js +12 -0
- package/dist-es/models/models_0.js +50 -1
- package/dist-es/protocols/Aws_restJson1.js +195 -323
- package/dist-types/SavingsplansClient.d.ts +2 -2
- package/dist-types/index.d.ts +1 -0
- package/dist-types/models/SavingsplansServiceException.d.ts +10 -0
- package/dist-types/models/models_0.d.ts +30 -17
- package/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/SavingsplansClient.d.ts +2 -2
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/models/SavingsplansServiceException.d.ts +6 -0
- package/dist-types/ts3.4/models/models_0.d.ts +22 -17
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/package.json +33 -33
|
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_re
|
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const uuid_1 = require("uuid");
|
|
7
|
+
const models_0_1 = require("../models/models_0");
|
|
8
|
+
const SavingsplansServiceException_1 = require("../models/SavingsplansServiceException");
|
|
7
9
|
const serializeAws_restJson1CreateSavingsPlanCommand = async (input, context) => {
|
|
8
10
|
var _a;
|
|
9
11
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -315,51 +317,25 @@ const deserializeAws_restJson1CreateSavingsPlanCommandError = async (output, con
|
|
|
315
317
|
switch (errorCode) {
|
|
316
318
|
case "InternalServerException":
|
|
317
319
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
318
|
-
|
|
319
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
320
|
-
name: errorCode,
|
|
321
|
-
$metadata: deserializeMetadata(output),
|
|
322
|
-
};
|
|
323
|
-
break;
|
|
320
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
324
321
|
case "ResourceNotFoundException":
|
|
325
322
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
326
|
-
|
|
327
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
328
|
-
name: errorCode,
|
|
329
|
-
$metadata: deserializeMetadata(output),
|
|
330
|
-
};
|
|
331
|
-
break;
|
|
323
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
332
324
|
case "ServiceQuotaExceededException":
|
|
333
325
|
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
334
|
-
|
|
335
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
336
|
-
name: errorCode,
|
|
337
|
-
$metadata: deserializeMetadata(output),
|
|
338
|
-
};
|
|
339
|
-
break;
|
|
326
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
340
327
|
case "ValidationException":
|
|
341
328
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
342
|
-
|
|
343
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
344
|
-
name: errorCode,
|
|
345
|
-
$metadata: deserializeMetadata(output),
|
|
346
|
-
};
|
|
347
|
-
break;
|
|
329
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
348
330
|
default:
|
|
349
331
|
const parsedBody = parsedOutput.body;
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
...parsedBody,
|
|
353
|
-
name: `${errorCode}`,
|
|
354
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
332
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
333
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
355
334
|
$fault: "client",
|
|
356
335
|
$metadata: deserializeMetadata(output),
|
|
357
|
-
};
|
|
336
|
+
});
|
|
337
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
358
338
|
}
|
|
359
|
-
const message = response.message || response.Message || errorCode;
|
|
360
|
-
response.message = message;
|
|
361
|
-
delete response.Message;
|
|
362
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
363
339
|
};
|
|
364
340
|
const deserializeAws_restJson1DeleteQueuedSavingsPlanCommand = async (output, context) => {
|
|
365
341
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -383,51 +359,25 @@ const deserializeAws_restJson1DeleteQueuedSavingsPlanCommandError = async (outpu
|
|
|
383
359
|
switch (errorCode) {
|
|
384
360
|
case "InternalServerException":
|
|
385
361
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
386
|
-
|
|
387
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
388
|
-
name: errorCode,
|
|
389
|
-
$metadata: deserializeMetadata(output),
|
|
390
|
-
};
|
|
391
|
-
break;
|
|
362
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
392
363
|
case "ResourceNotFoundException":
|
|
393
364
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
394
|
-
|
|
395
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
396
|
-
name: errorCode,
|
|
397
|
-
$metadata: deserializeMetadata(output),
|
|
398
|
-
};
|
|
399
|
-
break;
|
|
365
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
400
366
|
case "ServiceQuotaExceededException":
|
|
401
367
|
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
402
|
-
|
|
403
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
404
|
-
name: errorCode,
|
|
405
|
-
$metadata: deserializeMetadata(output),
|
|
406
|
-
};
|
|
407
|
-
break;
|
|
368
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
408
369
|
case "ValidationException":
|
|
409
370
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
410
|
-
|
|
411
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
412
|
-
name: errorCode,
|
|
413
|
-
$metadata: deserializeMetadata(output),
|
|
414
|
-
};
|
|
415
|
-
break;
|
|
371
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
416
372
|
default:
|
|
417
373
|
const parsedBody = parsedOutput.body;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
...parsedBody,
|
|
421
|
-
name: `${errorCode}`,
|
|
422
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
374
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
375
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
423
376
|
$fault: "client",
|
|
424
377
|
$metadata: deserializeMetadata(output),
|
|
425
|
-
};
|
|
378
|
+
});
|
|
379
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
426
380
|
}
|
|
427
|
-
const message = response.message || response.Message || errorCode;
|
|
428
|
-
response.message = message;
|
|
429
|
-
delete response.Message;
|
|
430
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
431
381
|
};
|
|
432
382
|
const deserializeAws_restJson1DescribeSavingsPlanRatesCommand = async (output, context) => {
|
|
433
383
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -463,35 +413,19 @@ const deserializeAws_restJson1DescribeSavingsPlanRatesCommandError = async (outp
|
|
|
463
413
|
switch (errorCode) {
|
|
464
414
|
case "ResourceNotFoundException":
|
|
465
415
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
466
|
-
|
|
467
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
468
|
-
name: errorCode,
|
|
469
|
-
$metadata: deserializeMetadata(output),
|
|
470
|
-
};
|
|
471
|
-
break;
|
|
416
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
472
417
|
case "ValidationException":
|
|
473
418
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
474
|
-
|
|
475
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
476
|
-
name: errorCode,
|
|
477
|
-
$metadata: deserializeMetadata(output),
|
|
478
|
-
};
|
|
479
|
-
break;
|
|
419
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
480
420
|
default:
|
|
481
421
|
const parsedBody = parsedOutput.body;
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
...parsedBody,
|
|
485
|
-
name: `${errorCode}`,
|
|
486
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
422
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
423
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
487
424
|
$fault: "client",
|
|
488
425
|
$metadata: deserializeMetadata(output),
|
|
489
|
-
};
|
|
426
|
+
});
|
|
427
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
490
428
|
}
|
|
491
|
-
const message = response.message || response.Message || errorCode;
|
|
492
|
-
response.message = message;
|
|
493
|
-
delete response.Message;
|
|
494
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
495
429
|
};
|
|
496
430
|
const deserializeAws_restJson1DescribeSavingsPlansCommand = async (output, context) => {
|
|
497
431
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -523,35 +457,19 @@ const deserializeAws_restJson1DescribeSavingsPlansCommandError = async (output,
|
|
|
523
457
|
switch (errorCode) {
|
|
524
458
|
case "InternalServerException":
|
|
525
459
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
526
|
-
|
|
527
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
528
|
-
name: errorCode,
|
|
529
|
-
$metadata: deserializeMetadata(output),
|
|
530
|
-
};
|
|
531
|
-
break;
|
|
460
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
532
461
|
case "ValidationException":
|
|
533
462
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
534
|
-
|
|
535
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
536
|
-
name: errorCode,
|
|
537
|
-
$metadata: deserializeMetadata(output),
|
|
538
|
-
};
|
|
539
|
-
break;
|
|
463
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
540
464
|
default:
|
|
541
465
|
const parsedBody = parsedOutput.body;
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
...parsedBody,
|
|
545
|
-
name: `${errorCode}`,
|
|
546
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
466
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
467
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
547
468
|
$fault: "client",
|
|
548
469
|
$metadata: deserializeMetadata(output),
|
|
549
|
-
};
|
|
470
|
+
});
|
|
471
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
550
472
|
}
|
|
551
|
-
const message = response.message || response.Message || errorCode;
|
|
552
|
-
response.message = message;
|
|
553
|
-
delete response.Message;
|
|
554
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
555
473
|
};
|
|
556
474
|
const deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand = async (output, context) => {
|
|
557
475
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -583,35 +501,19 @@ const deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommandError = as
|
|
|
583
501
|
switch (errorCode) {
|
|
584
502
|
case "InternalServerException":
|
|
585
503
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
586
|
-
|
|
587
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
588
|
-
name: errorCode,
|
|
589
|
-
$metadata: deserializeMetadata(output),
|
|
590
|
-
};
|
|
591
|
-
break;
|
|
504
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
592
505
|
case "ValidationException":
|
|
593
506
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
594
|
-
|
|
595
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
596
|
-
name: errorCode,
|
|
597
|
-
$metadata: deserializeMetadata(output),
|
|
598
|
-
};
|
|
599
|
-
break;
|
|
507
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
600
508
|
default:
|
|
601
509
|
const parsedBody = parsedOutput.body;
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
...parsedBody,
|
|
605
|
-
name: `${errorCode}`,
|
|
606
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
510
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
511
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
607
512
|
$fault: "client",
|
|
608
513
|
$metadata: deserializeMetadata(output),
|
|
609
|
-
};
|
|
514
|
+
});
|
|
515
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
610
516
|
}
|
|
611
|
-
const message = response.message || response.Message || errorCode;
|
|
612
|
-
response.message = message;
|
|
613
|
-
delete response.Message;
|
|
614
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
615
517
|
};
|
|
616
518
|
const deserializeAws_restJson1DescribeSavingsPlansOfferingsCommand = async (output, context) => {
|
|
617
519
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -643,35 +545,19 @@ const deserializeAws_restJson1DescribeSavingsPlansOfferingsCommandError = async
|
|
|
643
545
|
switch (errorCode) {
|
|
644
546
|
case "InternalServerException":
|
|
645
547
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
646
|
-
|
|
647
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
648
|
-
name: errorCode,
|
|
649
|
-
$metadata: deserializeMetadata(output),
|
|
650
|
-
};
|
|
651
|
-
break;
|
|
548
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
652
549
|
case "ValidationException":
|
|
653
550
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
654
|
-
|
|
655
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
656
|
-
name: errorCode,
|
|
657
|
-
$metadata: deserializeMetadata(output),
|
|
658
|
-
};
|
|
659
|
-
break;
|
|
551
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
660
552
|
default:
|
|
661
553
|
const parsedBody = parsedOutput.body;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
...parsedBody,
|
|
665
|
-
name: `${errorCode}`,
|
|
666
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
554
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
555
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
667
556
|
$fault: "client",
|
|
668
557
|
$metadata: deserializeMetadata(output),
|
|
669
|
-
};
|
|
558
|
+
});
|
|
559
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
670
560
|
}
|
|
671
|
-
const message = response.message || response.Message || errorCode;
|
|
672
|
-
response.message = message;
|
|
673
|
-
delete response.Message;
|
|
674
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
675
561
|
};
|
|
676
562
|
const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
677
563
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -699,43 +585,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
|
|
|
699
585
|
switch (errorCode) {
|
|
700
586
|
case "InternalServerException":
|
|
701
587
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
702
|
-
|
|
703
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
704
|
-
name: errorCode,
|
|
705
|
-
$metadata: deserializeMetadata(output),
|
|
706
|
-
};
|
|
707
|
-
break;
|
|
588
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
708
589
|
case "ResourceNotFoundException":
|
|
709
590
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
710
|
-
|
|
711
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
712
|
-
name: errorCode,
|
|
713
|
-
$metadata: deserializeMetadata(output),
|
|
714
|
-
};
|
|
715
|
-
break;
|
|
591
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
716
592
|
case "ValidationException":
|
|
717
593
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
718
|
-
|
|
719
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
720
|
-
name: errorCode,
|
|
721
|
-
$metadata: deserializeMetadata(output),
|
|
722
|
-
};
|
|
723
|
-
break;
|
|
594
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
724
595
|
default:
|
|
725
596
|
const parsedBody = parsedOutput.body;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
...parsedBody,
|
|
729
|
-
name: `${errorCode}`,
|
|
730
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
597
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
598
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
731
599
|
$fault: "client",
|
|
732
600
|
$metadata: deserializeMetadata(output),
|
|
733
|
-
};
|
|
601
|
+
});
|
|
602
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
734
603
|
}
|
|
735
|
-
const message = response.message || response.Message || errorCode;
|
|
736
|
-
response.message = message;
|
|
737
|
-
delete response.Message;
|
|
738
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
739
604
|
};
|
|
740
605
|
const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
741
606
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -759,51 +624,25 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
|
|
|
759
624
|
switch (errorCode) {
|
|
760
625
|
case "InternalServerException":
|
|
761
626
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
762
|
-
|
|
763
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
764
|
-
name: errorCode,
|
|
765
|
-
$metadata: deserializeMetadata(output),
|
|
766
|
-
};
|
|
767
|
-
break;
|
|
627
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
768
628
|
case "ResourceNotFoundException":
|
|
769
629
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
770
|
-
|
|
771
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
772
|
-
name: errorCode,
|
|
773
|
-
$metadata: deserializeMetadata(output),
|
|
774
|
-
};
|
|
775
|
-
break;
|
|
630
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
776
631
|
case "ServiceQuotaExceededException":
|
|
777
632
|
case "com.amazonaws.savingsplans#ServiceQuotaExceededException":
|
|
778
|
-
|
|
779
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
780
|
-
name: errorCode,
|
|
781
|
-
$metadata: deserializeMetadata(output),
|
|
782
|
-
};
|
|
783
|
-
break;
|
|
633
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
784
634
|
case "ValidationException":
|
|
785
635
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
786
|
-
|
|
787
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
788
|
-
name: errorCode,
|
|
789
|
-
$metadata: deserializeMetadata(output),
|
|
790
|
-
};
|
|
791
|
-
break;
|
|
636
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
792
637
|
default:
|
|
793
638
|
const parsedBody = parsedOutput.body;
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
...parsedBody,
|
|
797
|
-
name: `${errorCode}`,
|
|
798
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
639
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
640
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
799
641
|
$fault: "client",
|
|
800
642
|
$metadata: deserializeMetadata(output),
|
|
801
|
-
};
|
|
643
|
+
});
|
|
644
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
802
645
|
}
|
|
803
|
-
const message = response.message || response.Message || errorCode;
|
|
804
|
-
response.message = message;
|
|
805
|
-
delete response.Message;
|
|
806
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
807
646
|
};
|
|
808
647
|
const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
809
648
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -827,95 +666,70 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
|
|
|
827
666
|
switch (errorCode) {
|
|
828
667
|
case "InternalServerException":
|
|
829
668
|
case "com.amazonaws.savingsplans#InternalServerException":
|
|
830
|
-
|
|
831
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
832
|
-
name: errorCode,
|
|
833
|
-
$metadata: deserializeMetadata(output),
|
|
834
|
-
};
|
|
835
|
-
break;
|
|
669
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
836
670
|
case "ResourceNotFoundException":
|
|
837
671
|
case "com.amazonaws.savingsplans#ResourceNotFoundException":
|
|
838
|
-
|
|
839
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
840
|
-
name: errorCode,
|
|
841
|
-
$metadata: deserializeMetadata(output),
|
|
842
|
-
};
|
|
843
|
-
break;
|
|
672
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
844
673
|
case "ValidationException":
|
|
845
674
|
case "com.amazonaws.savingsplans#ValidationException":
|
|
846
|
-
|
|
847
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
848
|
-
name: errorCode,
|
|
849
|
-
$metadata: deserializeMetadata(output),
|
|
850
|
-
};
|
|
851
|
-
break;
|
|
675
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
852
676
|
default:
|
|
853
677
|
const parsedBody = parsedOutput.body;
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
...parsedBody,
|
|
857
|
-
name: `${errorCode}`,
|
|
858
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
678
|
+
response = new SavingsplansServiceException_1.SavingsplansServiceException({
|
|
679
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
859
680
|
$fault: "client",
|
|
860
681
|
$metadata: deserializeMetadata(output),
|
|
861
|
-
};
|
|
682
|
+
});
|
|
683
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
862
684
|
}
|
|
863
|
-
const message = response.message || response.Message || errorCode;
|
|
864
|
-
response.message = message;
|
|
865
|
-
delete response.Message;
|
|
866
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
867
685
|
};
|
|
868
686
|
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
869
|
-
const contents = {
|
|
870
|
-
name: "InternalServerException",
|
|
871
|
-
$fault: "server",
|
|
872
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
873
|
-
message: undefined,
|
|
874
|
-
};
|
|
687
|
+
const contents = {};
|
|
875
688
|
const data = parsedOutput.body;
|
|
876
689
|
if (data.message !== undefined && data.message !== null) {
|
|
877
690
|
contents.message = smithy_client_1.expectString(data.message);
|
|
878
691
|
}
|
|
879
|
-
|
|
692
|
+
const exception = new models_0_1.InternalServerException({
|
|
693
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
694
|
+
...contents,
|
|
695
|
+
});
|
|
696
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
880
697
|
};
|
|
881
698
|
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
882
|
-
const contents = {
|
|
883
|
-
name: "ResourceNotFoundException",
|
|
884
|
-
$fault: "client",
|
|
885
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
886
|
-
message: undefined,
|
|
887
|
-
};
|
|
699
|
+
const contents = {};
|
|
888
700
|
const data = parsedOutput.body;
|
|
889
701
|
if (data.message !== undefined && data.message !== null) {
|
|
890
702
|
contents.message = smithy_client_1.expectString(data.message);
|
|
891
703
|
}
|
|
892
|
-
|
|
704
|
+
const exception = new models_0_1.ResourceNotFoundException({
|
|
705
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
706
|
+
...contents,
|
|
707
|
+
});
|
|
708
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
893
709
|
};
|
|
894
710
|
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
895
|
-
const contents = {
|
|
896
|
-
name: "ServiceQuotaExceededException",
|
|
897
|
-
$fault: "client",
|
|
898
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
899
|
-
message: undefined,
|
|
900
|
-
};
|
|
711
|
+
const contents = {};
|
|
901
712
|
const data = parsedOutput.body;
|
|
902
713
|
if (data.message !== undefined && data.message !== null) {
|
|
903
714
|
contents.message = smithy_client_1.expectString(data.message);
|
|
904
715
|
}
|
|
905
|
-
|
|
716
|
+
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
717
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
718
|
+
...contents,
|
|
719
|
+
});
|
|
720
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
906
721
|
};
|
|
907
722
|
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
908
|
-
const contents = {
|
|
909
|
-
name: "ValidationException",
|
|
910
|
-
$fault: "client",
|
|
911
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
912
|
-
message: undefined,
|
|
913
|
-
};
|
|
723
|
+
const contents = {};
|
|
914
724
|
const data = parsedOutput.body;
|
|
915
725
|
if (data.message !== undefined && data.message !== null) {
|
|
916
726
|
contents.message = smithy_client_1.expectString(data.message);
|
|
917
727
|
}
|
|
918
|
-
|
|
728
|
+
const exception = new models_0_1.ValidationException({
|
|
729
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
730
|
+
...contents,
|
|
731
|
+
});
|
|
732
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
919
733
|
};
|
|
920
734
|
const serializeAws_restJson1CurrencyList = (input, context) => {
|
|
921
735
|
return input
|
|
@@ -1223,7 +1037,7 @@ const deserializeAws_restJson1SavingsPlan = (output, context) => {
|
|
|
1223
1037
|
};
|
|
1224
1038
|
};
|
|
1225
1039
|
const deserializeAws_restJson1SavingsPlanList = (output, context) => {
|
|
1226
|
-
|
|
1040
|
+
const retVal = (output || [])
|
|
1227
1041
|
.filter((e) => e != null)
|
|
1228
1042
|
.map((entry) => {
|
|
1229
1043
|
if (entry === null) {
|
|
@@ -1231,6 +1045,7 @@ const deserializeAws_restJson1SavingsPlanList = (output, context) => {
|
|
|
1231
1045
|
}
|
|
1232
1046
|
return deserializeAws_restJson1SavingsPlan(entry, context);
|
|
1233
1047
|
});
|
|
1048
|
+
return retVal;
|
|
1234
1049
|
};
|
|
1235
1050
|
const deserializeAws_restJson1SavingsPlanOffering = (output, context) => {
|
|
1236
1051
|
return {
|
|
@@ -1258,7 +1073,7 @@ const deserializeAws_restJson1SavingsPlanOfferingProperty = (output, context) =>
|
|
|
1258
1073
|
};
|
|
1259
1074
|
};
|
|
1260
1075
|
const deserializeAws_restJson1SavingsPlanOfferingPropertyList = (output, context) => {
|
|
1261
|
-
|
|
1076
|
+
const retVal = (output || [])
|
|
1262
1077
|
.filter((e) => e != null)
|
|
1263
1078
|
.map((entry) => {
|
|
1264
1079
|
if (entry === null) {
|
|
@@ -1266,6 +1081,7 @@ const deserializeAws_restJson1SavingsPlanOfferingPropertyList = (output, context
|
|
|
1266
1081
|
}
|
|
1267
1082
|
return deserializeAws_restJson1SavingsPlanOfferingProperty(entry, context);
|
|
1268
1083
|
});
|
|
1084
|
+
return retVal;
|
|
1269
1085
|
};
|
|
1270
1086
|
const deserializeAws_restJson1SavingsPlanOfferingRate = (output, context) => {
|
|
1271
1087
|
return {
|
|
@@ -1290,7 +1106,7 @@ const deserializeAws_restJson1SavingsPlanOfferingRateProperty = (output, context
|
|
|
1290
1106
|
};
|
|
1291
1107
|
};
|
|
1292
1108
|
const deserializeAws_restJson1SavingsPlanOfferingRatePropertyList = (output, context) => {
|
|
1293
|
-
|
|
1109
|
+
const retVal = (output || [])
|
|
1294
1110
|
.filter((e) => e != null)
|
|
1295
1111
|
.map((entry) => {
|
|
1296
1112
|
if (entry === null) {
|
|
@@ -1298,9 +1114,10 @@ const deserializeAws_restJson1SavingsPlanOfferingRatePropertyList = (output, con
|
|
|
1298
1114
|
}
|
|
1299
1115
|
return deserializeAws_restJson1SavingsPlanOfferingRateProperty(entry, context);
|
|
1300
1116
|
});
|
|
1117
|
+
return retVal;
|
|
1301
1118
|
};
|
|
1302
1119
|
const deserializeAws_restJson1SavingsPlanOfferingRatesList = (output, context) => {
|
|
1303
|
-
|
|
1120
|
+
const retVal = (output || [])
|
|
1304
1121
|
.filter((e) => e != null)
|
|
1305
1122
|
.map((entry) => {
|
|
1306
1123
|
if (entry === null) {
|
|
@@ -1308,9 +1125,10 @@ const deserializeAws_restJson1SavingsPlanOfferingRatesList = (output, context) =
|
|
|
1308
1125
|
}
|
|
1309
1126
|
return deserializeAws_restJson1SavingsPlanOfferingRate(entry, context);
|
|
1310
1127
|
});
|
|
1128
|
+
return retVal;
|
|
1311
1129
|
};
|
|
1312
1130
|
const deserializeAws_restJson1SavingsPlanOfferingsList = (output, context) => {
|
|
1313
|
-
|
|
1131
|
+
const retVal = (output || [])
|
|
1314
1132
|
.filter((e) => e != null)
|
|
1315
1133
|
.map((entry) => {
|
|
1316
1134
|
if (entry === null) {
|
|
@@ -1318,9 +1136,10 @@ const deserializeAws_restJson1SavingsPlanOfferingsList = (output, context) => {
|
|
|
1318
1136
|
}
|
|
1319
1137
|
return deserializeAws_restJson1SavingsPlanOffering(entry, context);
|
|
1320
1138
|
});
|
|
1139
|
+
return retVal;
|
|
1321
1140
|
};
|
|
1322
1141
|
const deserializeAws_restJson1SavingsPlanProductTypeList = (output, context) => {
|
|
1323
|
-
|
|
1142
|
+
const retVal = (output || [])
|
|
1324
1143
|
.filter((e) => e != null)
|
|
1325
1144
|
.map((entry) => {
|
|
1326
1145
|
if (entry === null) {
|
|
@@ -1328,6 +1147,7 @@ const deserializeAws_restJson1SavingsPlanProductTypeList = (output, context) =>
|
|
|
1328
1147
|
}
|
|
1329
1148
|
return smithy_client_1.expectString(entry);
|
|
1330
1149
|
});
|
|
1150
|
+
return retVal;
|
|
1331
1151
|
};
|
|
1332
1152
|
const deserializeAws_restJson1SavingsPlanRate = (output, context) => {
|
|
1333
1153
|
return {
|
|
@@ -1344,7 +1164,7 @@ const deserializeAws_restJson1SavingsPlanRate = (output, context) => {
|
|
|
1344
1164
|
};
|
|
1345
1165
|
};
|
|
1346
1166
|
const deserializeAws_restJson1SavingsPlanRateList = (output, context) => {
|
|
1347
|
-
|
|
1167
|
+
const retVal = (output || [])
|
|
1348
1168
|
.filter((e) => e != null)
|
|
1349
1169
|
.map((entry) => {
|
|
1350
1170
|
if (entry === null) {
|
|
@@ -1352,6 +1172,7 @@ const deserializeAws_restJson1SavingsPlanRateList = (output, context) => {
|
|
|
1352
1172
|
}
|
|
1353
1173
|
return deserializeAws_restJson1SavingsPlanRate(entry, context);
|
|
1354
1174
|
});
|
|
1175
|
+
return retVal;
|
|
1355
1176
|
};
|
|
1356
1177
|
const deserializeAws_restJson1SavingsPlanRateProperty = (output, context) => {
|
|
1357
1178
|
return {
|
|
@@ -1360,7 +1181,7 @@ const deserializeAws_restJson1SavingsPlanRateProperty = (output, context) => {
|
|
|
1360
1181
|
};
|
|
1361
1182
|
};
|
|
1362
1183
|
const deserializeAws_restJson1SavingsPlanRatePropertyList = (output, context) => {
|
|
1363
|
-
|
|
1184
|
+
const retVal = (output || [])
|
|
1364
1185
|
.filter((e) => e != null)
|
|
1365
1186
|
.map((entry) => {
|
|
1366
1187
|
if (entry === null) {
|
|
@@ -1368,6 +1189,7 @@ const deserializeAws_restJson1SavingsPlanRatePropertyList = (output, context) =>
|
|
|
1368
1189
|
}
|
|
1369
1190
|
return deserializeAws_restJson1SavingsPlanRateProperty(entry, context);
|
|
1370
1191
|
});
|
|
1192
|
+
return retVal;
|
|
1371
1193
|
};
|
|
1372
1194
|
const deserializeAws_restJson1TagMap = (output, context) => {
|
|
1373
1195
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
package/dist-es/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
|
|
3
|
+
var SavingsplansServiceException = (function (_super) {
|
|
4
|
+
__extends(SavingsplansServiceException, _super);
|
|
5
|
+
function SavingsplansServiceException(options) {
|
|
6
|
+
var _this = _super.call(this, options) || this;
|
|
7
|
+
Object.setPrototypeOf(_this, SavingsplansServiceException.prototype);
|
|
8
|
+
return _this;
|
|
9
|
+
}
|
|
10
|
+
return SavingsplansServiceException;
|
|
11
|
+
}(__ServiceException));
|
|
12
|
+
export { SavingsplansServiceException };
|