@aws-sdk/client-rum 3.50.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/RUMServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +105 -1
  5. package/dist-cjs/protocols/Aws_restJson1.js +140 -442
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/RUMServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +98 -1
  9. package/dist-es/protocols/Aws_restJson1.js +253 -490
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/RUMServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +52 -31
  13. package/dist-types/ts3.4/RUM.d.ts +55 -0
  14. package/dist-types/ts3.4/RUMClient.d.ts +83 -0
  15. package/dist-types/ts3.4/commands/CreateAppMonitorCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/DeleteAppMonitorCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/GetAppMonitorCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/GetAppMonitorDataCommand.d.ts +17 -0
  19. package/dist-types/ts3.4/commands/ListAppMonitorsCommand.d.ts +17 -0
  20. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  21. package/dist-types/ts3.4/commands/PutRumEventsCommand.d.ts +17 -0
  22. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  23. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  24. package/dist-types/ts3.4/commands/UpdateAppMonitorCommand.d.ts +17 -0
  25. package/dist-types/ts3.4/commands/index.d.ts +10 -0
  26. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  27. package/dist-types/ts3.4/index.d.ts +6 -0
  28. package/dist-types/ts3.4/models/RUMServiceException.d.ts +6 -0
  29. package/dist-types/ts3.4/models/index.d.ts +1 -0
  30. package/dist-types/ts3.4/models/models_0.d.ts +434 -0
  31. package/dist-types/ts3.4/pagination/GetAppMonitorDataPaginator.d.ts +4 -0
  32. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  33. package/dist-types/ts3.4/pagination/ListAppMonitorsPaginator.d.ts +4 -0
  34. package/dist-types/ts3.4/pagination/index.d.ts +3 -0
  35. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +32 -0
  36. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  37. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  38. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  39. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  40. package/package.json +33 -33
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1UpdateAppMonitorCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PutRumEventsCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListAppMonitorsCommand = exports.deserializeAws_restJson1GetAppMonitorDataCommand = exports.deserializeAws_restJson1GetAppMonitorCommand = exports.deserializeAws_restJson1DeleteAppMonitorCommand = exports.deserializeAws_restJson1CreateAppMonitorCommand = exports.serializeAws_restJson1UpdateAppMonitorCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PutRumEventsCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListAppMonitorsCommand = exports.serializeAws_restJson1GetAppMonitorDataCommand = exports.serializeAws_restJson1GetAppMonitorCommand = exports.serializeAws_restJson1DeleteAppMonitorCommand = exports.serializeAws_restJson1CreateAppMonitorCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const RUMServiceException_1 = require("../models/RUMServiceException");
6
8
  const serializeAws_restJson1CreateAppMonitorCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {
@@ -335,67 +337,31 @@ const deserializeAws_restJson1CreateAppMonitorCommandError = async (output, cont
335
337
  switch (errorCode) {
336
338
  case "AccessDeniedException":
337
339
  case "com.amazonaws.rum#AccessDeniedException":
338
- response = {
339
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
340
- name: errorCode,
341
- $metadata: deserializeMetadata(output),
342
- };
343
- break;
340
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
344
341
  case "ConflictException":
345
342
  case "com.amazonaws.rum#ConflictException":
346
- response = {
347
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
348
- name: errorCode,
349
- $metadata: deserializeMetadata(output),
350
- };
351
- break;
343
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
352
344
  case "InternalServerException":
353
345
  case "com.amazonaws.rum#InternalServerException":
354
- response = {
355
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
356
- name: errorCode,
357
- $metadata: deserializeMetadata(output),
358
- };
359
- break;
346
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
360
347
  case "ServiceQuotaExceededException":
361
348
  case "com.amazonaws.rum#ServiceQuotaExceededException":
362
- response = {
363
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
364
- name: errorCode,
365
- $metadata: deserializeMetadata(output),
366
- };
367
- break;
349
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
368
350
  case "ThrottlingException":
369
351
  case "com.amazonaws.rum#ThrottlingException":
370
- response = {
371
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
372
- name: errorCode,
373
- $metadata: deserializeMetadata(output),
374
- };
375
- break;
352
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
376
353
  case "ValidationException":
377
354
  case "com.amazonaws.rum#ValidationException":
378
- response = {
379
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
380
- name: errorCode,
381
- $metadata: deserializeMetadata(output),
382
- };
383
- break;
355
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
384
356
  default:
385
357
  const parsedBody = parsedOutput.body;
386
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
387
- response = {
388
- ...parsedBody,
389
- name: `${errorCode}`,
390
- message: parsedBody.message || parsedBody.Message || errorCode,
358
+ response = new RUMServiceException_1.RUMServiceException({
359
+ name: parsedBody.code || parsedBody.Code || errorCode,
391
360
  $fault: "client",
392
361
  $metadata: deserializeMetadata(output),
393
- };
362
+ });
363
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
394
364
  }
395
- const message = response.message || response.Message || errorCode;
396
- response.message = message;
397
- delete response.Message;
398
- return Promise.reject(Object.assign(new Error(message), response));
399
365
  };
400
366
  const deserializeAws_restJson1DeleteAppMonitorCommand = async (output, context) => {
401
367
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -419,67 +385,31 @@ const deserializeAws_restJson1DeleteAppMonitorCommandError = async (output, cont
419
385
  switch (errorCode) {
420
386
  case "AccessDeniedException":
421
387
  case "com.amazonaws.rum#AccessDeniedException":
422
- response = {
423
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
424
- name: errorCode,
425
- $metadata: deserializeMetadata(output),
426
- };
427
- break;
388
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
428
389
  case "ConflictException":
429
390
  case "com.amazonaws.rum#ConflictException":
430
- response = {
431
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
432
- name: errorCode,
433
- $metadata: deserializeMetadata(output),
434
- };
435
- break;
391
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
436
392
  case "InternalServerException":
437
393
  case "com.amazonaws.rum#InternalServerException":
438
- response = {
439
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
440
- name: errorCode,
441
- $metadata: deserializeMetadata(output),
442
- };
443
- break;
394
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
444
395
  case "ResourceNotFoundException":
445
396
  case "com.amazonaws.rum#ResourceNotFoundException":
446
- response = {
447
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
448
- name: errorCode,
449
- $metadata: deserializeMetadata(output),
450
- };
451
- break;
397
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
452
398
  case "ThrottlingException":
453
399
  case "com.amazonaws.rum#ThrottlingException":
454
- response = {
455
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
456
- name: errorCode,
457
- $metadata: deserializeMetadata(output),
458
- };
459
- break;
400
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
460
401
  case "ValidationException":
461
402
  case "com.amazonaws.rum#ValidationException":
462
- response = {
463
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
464
- name: errorCode,
465
- $metadata: deserializeMetadata(output),
466
- };
467
- break;
403
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
468
404
  default:
469
405
  const parsedBody = parsedOutput.body;
470
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
471
- response = {
472
- ...parsedBody,
473
- name: `${errorCode}`,
474
- message: parsedBody.message || parsedBody.Message || errorCode,
406
+ response = new RUMServiceException_1.RUMServiceException({
407
+ name: parsedBody.code || parsedBody.Code || errorCode,
475
408
  $fault: "client",
476
409
  $metadata: deserializeMetadata(output),
477
- };
410
+ });
411
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
478
412
  }
479
- const message = response.message || response.Message || errorCode;
480
- response.message = message;
481
- delete response.Message;
482
- return Promise.reject(Object.assign(new Error(message), response));
483
413
  };
484
414
  const deserializeAws_restJson1GetAppMonitorCommand = async (output, context) => {
485
415
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -507,59 +437,28 @@ const deserializeAws_restJson1GetAppMonitorCommandError = async (output, context
507
437
  switch (errorCode) {
508
438
  case "AccessDeniedException":
509
439
  case "com.amazonaws.rum#AccessDeniedException":
510
- response = {
511
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
440
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
516
441
  case "InternalServerException":
517
442
  case "com.amazonaws.rum#InternalServerException":
518
- response = {
519
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
520
- name: errorCode,
521
- $metadata: deserializeMetadata(output),
522
- };
523
- break;
443
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
524
444
  case "ResourceNotFoundException":
525
445
  case "com.amazonaws.rum#ResourceNotFoundException":
526
- response = {
527
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
528
- name: errorCode,
529
- $metadata: deserializeMetadata(output),
530
- };
531
- break;
446
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
532
447
  case "ThrottlingException":
533
448
  case "com.amazonaws.rum#ThrottlingException":
534
- response = {
535
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
536
- name: errorCode,
537
- $metadata: deserializeMetadata(output),
538
- };
539
- break;
449
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
540
450
  case "ValidationException":
541
451
  case "com.amazonaws.rum#ValidationException":
542
- response = {
543
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
544
- name: errorCode,
545
- $metadata: deserializeMetadata(output),
546
- };
547
- break;
452
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
548
453
  default:
549
454
  const parsedBody = parsedOutput.body;
550
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
551
- response = {
552
- ...parsedBody,
553
- name: `${errorCode}`,
554
- message: parsedBody.message || parsedBody.Message || errorCode,
455
+ response = new RUMServiceException_1.RUMServiceException({
456
+ name: parsedBody.code || parsedBody.Code || errorCode,
555
457
  $fault: "client",
556
458
  $metadata: deserializeMetadata(output),
557
- };
459
+ });
460
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
558
461
  }
559
- const message = response.message || response.Message || errorCode;
560
- response.message = message;
561
- delete response.Message;
562
- return Promise.reject(Object.assign(new Error(message), response));
563
462
  };
564
463
  const deserializeAws_restJson1GetAppMonitorDataCommand = async (output, context) => {
565
464
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -591,59 +490,28 @@ const deserializeAws_restJson1GetAppMonitorDataCommandError = async (output, con
591
490
  switch (errorCode) {
592
491
  case "AccessDeniedException":
593
492
  case "com.amazonaws.rum#AccessDeniedException":
594
- response = {
595
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
596
- name: errorCode,
597
- $metadata: deserializeMetadata(output),
598
- };
599
- break;
493
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
600
494
  case "InternalServerException":
601
495
  case "com.amazonaws.rum#InternalServerException":
602
- response = {
603
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
604
- name: errorCode,
605
- $metadata: deserializeMetadata(output),
606
- };
607
- break;
496
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
608
497
  case "ResourceNotFoundException":
609
498
  case "com.amazonaws.rum#ResourceNotFoundException":
610
- response = {
611
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
612
- name: errorCode,
613
- $metadata: deserializeMetadata(output),
614
- };
615
- break;
499
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
616
500
  case "ThrottlingException":
617
501
  case "com.amazonaws.rum#ThrottlingException":
618
- response = {
619
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
620
- name: errorCode,
621
- $metadata: deserializeMetadata(output),
622
- };
623
- break;
502
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
624
503
  case "ValidationException":
625
504
  case "com.amazonaws.rum#ValidationException":
626
- response = {
627
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
628
- name: errorCode,
629
- $metadata: deserializeMetadata(output),
630
- };
631
- break;
505
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
632
506
  default:
633
507
  const parsedBody = parsedOutput.body;
634
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
635
- response = {
636
- ...parsedBody,
637
- name: `${errorCode}`,
638
- message: parsedBody.message || parsedBody.Message || errorCode,
508
+ response = new RUMServiceException_1.RUMServiceException({
509
+ name: parsedBody.code || parsedBody.Code || errorCode,
639
510
  $fault: "client",
640
511
  $metadata: deserializeMetadata(output),
641
- };
512
+ });
513
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
642
514
  }
643
- const message = response.message || response.Message || errorCode;
644
- response.message = message;
645
- delete response.Message;
646
- return Promise.reject(Object.assign(new Error(message), response));
647
515
  };
648
516
  const deserializeAws_restJson1ListAppMonitorsCommand = async (output, context) => {
649
517
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -675,51 +543,25 @@ const deserializeAws_restJson1ListAppMonitorsCommandError = async (output, conte
675
543
  switch (errorCode) {
676
544
  case "AccessDeniedException":
677
545
  case "com.amazonaws.rum#AccessDeniedException":
678
- response = {
679
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
680
- name: errorCode,
681
- $metadata: deserializeMetadata(output),
682
- };
683
- break;
546
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
684
547
  case "InternalServerException":
685
548
  case "com.amazonaws.rum#InternalServerException":
686
- response = {
687
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
688
- name: errorCode,
689
- $metadata: deserializeMetadata(output),
690
- };
691
- break;
549
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
692
550
  case "ThrottlingException":
693
551
  case "com.amazonaws.rum#ThrottlingException":
694
- response = {
695
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
696
- name: errorCode,
697
- $metadata: deserializeMetadata(output),
698
- };
699
- break;
552
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
700
553
  case "ValidationException":
701
554
  case "com.amazonaws.rum#ValidationException":
702
- response = {
703
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
704
- name: errorCode,
705
- $metadata: deserializeMetadata(output),
706
- };
707
- break;
555
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
708
556
  default:
709
557
  const parsedBody = parsedOutput.body;
710
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
711
- response = {
712
- ...parsedBody,
713
- name: `${errorCode}`,
714
- message: parsedBody.message || parsedBody.Message || errorCode,
558
+ response = new RUMServiceException_1.RUMServiceException({
559
+ name: parsedBody.code || parsedBody.Code || errorCode,
715
560
  $fault: "client",
716
561
  $metadata: deserializeMetadata(output),
717
- };
562
+ });
563
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
718
564
  }
719
- const message = response.message || response.Message || errorCode;
720
- response.message = message;
721
- delete response.Message;
722
- return Promise.reject(Object.assign(new Error(message), response));
723
565
  };
724
566
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
725
567
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -751,43 +593,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
751
593
  switch (errorCode) {
752
594
  case "InternalServerException":
753
595
  case "com.amazonaws.rum#InternalServerException":
754
- response = {
755
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
756
- name: errorCode,
757
- $metadata: deserializeMetadata(output),
758
- };
759
- break;
596
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
760
597
  case "ResourceNotFoundException":
761
598
  case "com.amazonaws.rum#ResourceNotFoundException":
762
- response = {
763
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
764
- name: errorCode,
765
- $metadata: deserializeMetadata(output),
766
- };
767
- break;
599
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
768
600
  case "ValidationException":
769
601
  case "com.amazonaws.rum#ValidationException":
770
- response = {
771
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
772
- name: errorCode,
773
- $metadata: deserializeMetadata(output),
774
- };
775
- break;
602
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
776
603
  default:
777
604
  const parsedBody = parsedOutput.body;
778
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
779
- response = {
780
- ...parsedBody,
781
- name: `${errorCode}`,
782
- message: parsedBody.message || parsedBody.Message || errorCode,
605
+ response = new RUMServiceException_1.RUMServiceException({
606
+ name: parsedBody.code || parsedBody.Code || errorCode,
783
607
  $fault: "client",
784
608
  $metadata: deserializeMetadata(output),
785
- };
609
+ });
610
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
786
611
  }
787
- const message = response.message || response.Message || errorCode;
788
- response.message = message;
789
- delete response.Message;
790
- return Promise.reject(Object.assign(new Error(message), response));
791
612
  };
792
613
  const deserializeAws_restJson1PutRumEventsCommand = async (output, context) => {
793
614
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -811,59 +632,28 @@ const deserializeAws_restJson1PutRumEventsCommandError = async (output, context)
811
632
  switch (errorCode) {
812
633
  case "AccessDeniedException":
813
634
  case "com.amazonaws.rum#AccessDeniedException":
814
- response = {
815
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
816
- name: errorCode,
817
- $metadata: deserializeMetadata(output),
818
- };
819
- break;
635
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
820
636
  case "InternalServerException":
821
637
  case "com.amazonaws.rum#InternalServerException":
822
- response = {
823
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
824
- name: errorCode,
825
- $metadata: deserializeMetadata(output),
826
- };
827
- break;
638
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
828
639
  case "ResourceNotFoundException":
829
640
  case "com.amazonaws.rum#ResourceNotFoundException":
830
- response = {
831
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
832
- name: errorCode,
833
- $metadata: deserializeMetadata(output),
834
- };
835
- break;
641
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
836
642
  case "ThrottlingException":
837
643
  case "com.amazonaws.rum#ThrottlingException":
838
- response = {
839
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
840
- name: errorCode,
841
- $metadata: deserializeMetadata(output),
842
- };
843
- break;
644
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
844
645
  case "ValidationException":
845
646
  case "com.amazonaws.rum#ValidationException":
846
- response = {
847
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
848
- name: errorCode,
849
- $metadata: deserializeMetadata(output),
850
- };
851
- break;
647
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
852
648
  default:
853
649
  const parsedBody = parsedOutput.body;
854
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
855
- response = {
856
- ...parsedBody,
857
- name: `${errorCode}`,
858
- message: parsedBody.message || parsedBody.Message || errorCode,
650
+ response = new RUMServiceException_1.RUMServiceException({
651
+ name: parsedBody.code || parsedBody.Code || errorCode,
859
652
  $fault: "client",
860
653
  $metadata: deserializeMetadata(output),
861
- };
654
+ });
655
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
862
656
  }
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
657
  };
868
658
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
869
659
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -887,43 +677,22 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
887
677
  switch (errorCode) {
888
678
  case "InternalServerException":
889
679
  case "com.amazonaws.rum#InternalServerException":
890
- response = {
891
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
892
- name: errorCode,
893
- $metadata: deserializeMetadata(output),
894
- };
895
- break;
680
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
896
681
  case "ResourceNotFoundException":
897
682
  case "com.amazonaws.rum#ResourceNotFoundException":
898
- response = {
899
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
900
- name: errorCode,
901
- $metadata: deserializeMetadata(output),
902
- };
903
- break;
683
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
904
684
  case "ValidationException":
905
685
  case "com.amazonaws.rum#ValidationException":
906
- response = {
907
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
908
- name: errorCode,
909
- $metadata: deserializeMetadata(output),
910
- };
911
- break;
686
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
912
687
  default:
913
688
  const parsedBody = parsedOutput.body;
914
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
915
- response = {
916
- ...parsedBody,
917
- name: `${errorCode}`,
918
- message: parsedBody.message || parsedBody.Message || errorCode,
689
+ response = new RUMServiceException_1.RUMServiceException({
690
+ name: parsedBody.code || parsedBody.Code || errorCode,
919
691
  $fault: "client",
920
692
  $metadata: deserializeMetadata(output),
921
- };
693
+ });
694
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
922
695
  }
923
- const message = response.message || response.Message || errorCode;
924
- response.message = message;
925
- delete response.Message;
926
- return Promise.reject(Object.assign(new Error(message), response));
927
696
  };
928
697
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
929
698
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -947,43 +716,22 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
947
716
  switch (errorCode) {
948
717
  case "InternalServerException":
949
718
  case "com.amazonaws.rum#InternalServerException":
950
- response = {
951
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
719
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
956
720
  case "ResourceNotFoundException":
957
721
  case "com.amazonaws.rum#ResourceNotFoundException":
958
- response = {
959
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
722
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
964
723
  case "ValidationException":
965
724
  case "com.amazonaws.rum#ValidationException":
966
- response = {
967
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
968
- name: errorCode,
969
- $metadata: deserializeMetadata(output),
970
- };
971
- break;
725
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
972
726
  default:
973
727
  const parsedBody = parsedOutput.body;
974
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
975
- response = {
976
- ...parsedBody,
977
- name: `${errorCode}`,
978
- message: parsedBody.message || parsedBody.Message || errorCode,
728
+ response = new RUMServiceException_1.RUMServiceException({
729
+ name: parsedBody.code || parsedBody.Code || errorCode,
979
730
  $fault: "client",
980
731
  $metadata: deserializeMetadata(output),
981
- };
732
+ });
733
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
982
734
  }
983
- const message = response.message || response.Message || errorCode;
984
- response.message = message;
985
- delete response.Message;
986
- return Promise.reject(Object.assign(new Error(message), response));
987
735
  };
988
736
  const deserializeAws_restJson1UpdateAppMonitorCommand = async (output, context) => {
989
737
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1007,90 +755,46 @@ const deserializeAws_restJson1UpdateAppMonitorCommandError = async (output, cont
1007
755
  switch (errorCode) {
1008
756
  case "AccessDeniedException":
1009
757
  case "com.amazonaws.rum#AccessDeniedException":
1010
- response = {
1011
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1012
- name: errorCode,
1013
- $metadata: deserializeMetadata(output),
1014
- };
1015
- break;
758
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1016
759
  case "ConflictException":
1017
760
  case "com.amazonaws.rum#ConflictException":
1018
- response = {
1019
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1020
- name: errorCode,
1021
- $metadata: deserializeMetadata(output),
1022
- };
1023
- break;
761
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1024
762
  case "InternalServerException":
1025
763
  case "com.amazonaws.rum#InternalServerException":
1026
- response = {
1027
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1028
- name: errorCode,
1029
- $metadata: deserializeMetadata(output),
1030
- };
1031
- break;
764
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1032
765
  case "ResourceNotFoundException":
1033
766
  case "com.amazonaws.rum#ResourceNotFoundException":
1034
- response = {
1035
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1036
- name: errorCode,
1037
- $metadata: deserializeMetadata(output),
1038
- };
1039
- break;
767
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1040
768
  case "ThrottlingException":
1041
769
  case "com.amazonaws.rum#ThrottlingException":
1042
- response = {
1043
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1044
- name: errorCode,
1045
- $metadata: deserializeMetadata(output),
1046
- };
1047
- break;
770
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1048
771
  case "ValidationException":
1049
772
  case "com.amazonaws.rum#ValidationException":
1050
- response = {
1051
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1052
- name: errorCode,
1053
- $metadata: deserializeMetadata(output),
1054
- };
1055
- break;
773
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1056
774
  default:
1057
775
  const parsedBody = parsedOutput.body;
1058
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1059
- response = {
1060
- ...parsedBody,
1061
- name: `${errorCode}`,
1062
- message: parsedBody.message || parsedBody.Message || errorCode,
776
+ response = new RUMServiceException_1.RUMServiceException({
777
+ name: parsedBody.code || parsedBody.Code || errorCode,
1063
778
  $fault: "client",
1064
779
  $metadata: deserializeMetadata(output),
1065
- };
780
+ });
781
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1066
782
  }
1067
- const message = response.message || response.Message || errorCode;
1068
- response.message = message;
1069
- delete response.Message;
1070
- return Promise.reject(Object.assign(new Error(message), response));
1071
783
  };
1072
784
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1073
- const contents = {
1074
- name: "AccessDeniedException",
1075
- $fault: "client",
1076
- $metadata: deserializeMetadata(parsedOutput),
1077
- message: undefined,
1078
- };
785
+ const contents = {};
1079
786
  const data = parsedOutput.body;
1080
787
  if (data.message !== undefined && data.message !== null) {
1081
788
  contents.message = smithy_client_1.expectString(data.message);
1082
789
  }
1083
- return contents;
790
+ const exception = new models_0_1.AccessDeniedException({
791
+ $metadata: deserializeMetadata(parsedOutput),
792
+ ...contents,
793
+ });
794
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1084
795
  };
1085
796
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1086
- const contents = {
1087
- name: "ConflictException",
1088
- $fault: "client",
1089
- $metadata: deserializeMetadata(parsedOutput),
1090
- message: undefined,
1091
- resourceName: undefined,
1092
- resourceType: undefined,
1093
- };
797
+ const contents = {};
1094
798
  const data = parsedOutput.body;
1095
799
  if (data.message !== undefined && data.message !== null) {
1096
800
  contents.message = smithy_client_1.expectString(data.message);
@@ -1101,17 +805,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1101
805
  if (data.resourceType !== undefined && data.resourceType !== null) {
1102
806
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
1103
807
  }
1104
- return contents;
808
+ const exception = new models_0_1.ConflictException({
809
+ $metadata: deserializeMetadata(parsedOutput),
810
+ ...contents,
811
+ });
812
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1105
813
  };
1106
814
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1107
- const contents = {
1108
- name: "InternalServerException",
1109
- $fault: "server",
1110
- $retryable: {},
1111
- $metadata: deserializeMetadata(parsedOutput),
1112
- message: undefined,
1113
- retryAfterSeconds: undefined,
1114
- };
815
+ const contents = {};
1115
816
  if (parsedOutput.headers["retry-after"] !== undefined) {
1116
817
  contents.retryAfterSeconds = smithy_client_1.strictParseInt32(parsedOutput.headers["retry-after"]);
1117
818
  }
@@ -1119,17 +820,14 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
1119
820
  if (data.message !== undefined && data.message !== null) {
1120
821
  contents.message = smithy_client_1.expectString(data.message);
1121
822
  }
1122
- return contents;
823
+ const exception = new models_0_1.InternalServerException({
824
+ $metadata: deserializeMetadata(parsedOutput),
825
+ ...contents,
826
+ });
827
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1123
828
  };
1124
829
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1125
- const contents = {
1126
- name: "ResourceNotFoundException",
1127
- $fault: "client",
1128
- $metadata: deserializeMetadata(parsedOutput),
1129
- message: undefined,
1130
- resourceName: undefined,
1131
- resourceType: undefined,
1132
- };
830
+ const contents = {};
1133
831
  const data = parsedOutput.body;
1134
832
  if (data.message !== undefined && data.message !== null) {
1135
833
  contents.message = smithy_client_1.expectString(data.message);
@@ -1140,34 +838,26 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
1140
838
  if (data.resourceType !== undefined && data.resourceType !== null) {
1141
839
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
1142
840
  }
1143
- return contents;
841
+ const exception = new models_0_1.ResourceNotFoundException({
842
+ $metadata: deserializeMetadata(parsedOutput),
843
+ ...contents,
844
+ });
845
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1144
846
  };
1145
847
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1146
- const contents = {
1147
- name: "ServiceQuotaExceededException",
1148
- $fault: "client",
1149
- $metadata: deserializeMetadata(parsedOutput),
1150
- message: undefined,
1151
- };
848
+ const contents = {};
1152
849
  const data = parsedOutput.body;
1153
850
  if (data.message !== undefined && data.message !== null) {
1154
851
  contents.message = smithy_client_1.expectString(data.message);
1155
852
  }
1156
- return contents;
853
+ const exception = new models_0_1.ServiceQuotaExceededException({
854
+ $metadata: deserializeMetadata(parsedOutput),
855
+ ...contents,
856
+ });
857
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1157
858
  };
1158
859
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1159
- const contents = {
1160
- name: "ThrottlingException",
1161
- $fault: "client",
1162
- $retryable: {
1163
- throttling: true,
1164
- },
1165
- $metadata: deserializeMetadata(parsedOutput),
1166
- message: undefined,
1167
- quotaCode: undefined,
1168
- retryAfterSeconds: undefined,
1169
- serviceCode: undefined,
1170
- };
860
+ const contents = {};
1171
861
  if (parsedOutput.headers["retry-after"] !== undefined) {
1172
862
  contents.retryAfterSeconds = smithy_client_1.strictParseInt32(parsedOutput.headers["retry-after"]);
1173
863
  }
@@ -1181,20 +871,23 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
1181
871
  if (data.serviceCode !== undefined && data.serviceCode !== null) {
1182
872
  contents.serviceCode = smithy_client_1.expectString(data.serviceCode);
1183
873
  }
1184
- return contents;
874
+ const exception = new models_0_1.ThrottlingException({
875
+ $metadata: deserializeMetadata(parsedOutput),
876
+ ...contents,
877
+ });
878
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1185
879
  };
1186
880
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1187
- const contents = {
1188
- name: "ValidationException",
1189
- $fault: "client",
1190
- $metadata: deserializeMetadata(parsedOutput),
1191
- message: undefined,
1192
- };
881
+ const contents = {};
1193
882
  const data = parsedOutput.body;
1194
883
  if (data.message !== undefined && data.message !== null) {
1195
884
  contents.message = smithy_client_1.expectString(data.message);
1196
885
  }
1197
- return contents;
886
+ const exception = new models_0_1.ValidationException({
887
+ $metadata: deserializeMetadata(parsedOutput),
888
+ ...contents,
889
+ });
890
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1198
891
  };
1199
892
  const serializeAws_restJson1AppMonitorConfiguration = (input, context) => {
1200
893
  return {
@@ -1376,7 +1069,7 @@ const deserializeAws_restJson1AppMonitorSummary = (output, context) => {
1376
1069
  };
1377
1070
  };
1378
1071
  const deserializeAws_restJson1AppMonitorSummaryList = (output, context) => {
1379
- return (output || [])
1072
+ const retVal = (output || [])
1380
1073
  .filter((e) => e != null)
1381
1074
  .map((entry) => {
1382
1075
  if (entry === null) {
@@ -1384,6 +1077,7 @@ const deserializeAws_restJson1AppMonitorSummaryList = (output, context) => {
1384
1077
  }
1385
1078
  return deserializeAws_restJson1AppMonitorSummary(entry, context);
1386
1079
  });
1080
+ return retVal;
1387
1081
  };
1388
1082
  const deserializeAws_restJson1CwLog = (output, context) => {
1389
1083
  return {
@@ -1399,7 +1093,7 @@ const deserializeAws_restJson1DataStorage = (output, context) => {
1399
1093
  };
1400
1094
  };
1401
1095
  const deserializeAws_restJson1EventDataList = (output, context) => {
1402
- return (output || [])
1096
+ const retVal = (output || [])
1403
1097
  .filter((e) => e != null)
1404
1098
  .map((entry) => {
1405
1099
  if (entry === null) {
@@ -1407,9 +1101,10 @@ const deserializeAws_restJson1EventDataList = (output, context) => {
1407
1101
  }
1408
1102
  return smithy_client_1.expectString(entry);
1409
1103
  });
1104
+ return retVal;
1410
1105
  };
1411
1106
  const deserializeAws_restJson1FavoritePages = (output, context) => {
1412
- return (output || [])
1107
+ const retVal = (output || [])
1413
1108
  .filter((e) => e != null)
1414
1109
  .map((entry) => {
1415
1110
  if (entry === null) {
@@ -1417,9 +1112,10 @@ const deserializeAws_restJson1FavoritePages = (output, context) => {
1417
1112
  }
1418
1113
  return smithy_client_1.expectString(entry);
1419
1114
  });
1115
+ return retVal;
1420
1116
  };
1421
1117
  const deserializeAws_restJson1Pages = (output, context) => {
1422
- return (output || [])
1118
+ const retVal = (output || [])
1423
1119
  .filter((e) => e != null)
1424
1120
  .map((entry) => {
1425
1121
  if (entry === null) {
@@ -1427,6 +1123,7 @@ const deserializeAws_restJson1Pages = (output, context) => {
1427
1123
  }
1428
1124
  return smithy_client_1.expectString(entry);
1429
1125
  });
1126
+ return retVal;
1430
1127
  };
1431
1128
  const deserializeAws_restJson1TagMap = (output, context) => {
1432
1129
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -1440,7 +1137,7 @@ const deserializeAws_restJson1TagMap = (output, context) => {
1440
1137
  }, {});
1441
1138
  };
1442
1139
  const deserializeAws_restJson1Telemetries = (output, context) => {
1443
- return (output || [])
1140
+ const retVal = (output || [])
1444
1141
  .filter((e) => e != null)
1445
1142
  .map((entry) => {
1446
1143
  if (entry === null) {
@@ -1448,6 +1145,7 @@ const deserializeAws_restJson1Telemetries = (output, context) => {
1448
1145
  }
1449
1146
  return smithy_client_1.expectString(entry);
1450
1147
  });
1148
+ return retVal;
1451
1149
  };
1452
1150
  const deserializeMetadata = (output) => {
1453
1151
  var _a;